5 #include <boost/bind/bind.hpp>
8 using namespace boost::placeholders;
13 timeout_changed_(false), tbb_awake_timer_(NULL) { }
16 const std::string task_name,
17 uint32_t tbbKeepawakeTimeout = 1000) {
18 uint32_t task_id = ts->
GetTaskId(task_name);
22 tbb_awake_val_ = tbbKeepawakeTimeout;
23 bool ret = tbb_awake_timer_->Start(tbbKeepawakeTimeout,
29 std::scoped_lock lock(mutex_);
30 if (tbb_awake_val_ != timeout) {
31 timeout_changed_ =
true;
32 tbb_awake_val_ = timeout;
38 if (timeout_changed_) {
39 tbb_awake_timer_->Reschedule(tbb_awake_val_);
40 timeout_changed_ =
false;
46 if (tbb_awake_timer_) {
47 tbb_awake_timer_->Cancel();
boost::asio::io_context * io_service()
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
int GetTaskId(const std::string &name)
bool StartTbbKeepAwakeTask(TaskScheduler *ts, EventManager *event_mgr, const std::string task_name, uint32_t tbbKeepawakeTimeout=1000)
uint64_t tbb_awake_count_
void ModifyTbbKeepAwakeTimeout(uint32_t timeout)
void ShutTbbKeepAwakeTask()
uint32_t tbb_awake_val() const
static bool DeleteTimer(Timer *Timer)
static Timer * CreateTimer(boost::asio::io_context &service, const std::string &name, int task_id=Timer::GetTimerTaskId(), int task_instance=Timer::GetTimerInstanceId(), bool delete_on_completion=false)