12 #ifndef ROC_CTL_CONTROL_TASK_QUEUE_H_
13 #define ROC_CTL_CONTROL_TASK_QUEUE_H_
226 void start_thread_();
253 void reborn_task_(
ControlTask& task, ControlTask::State from_state);
254 void pause_task_(
ControlTask& task, ControlTask::State from_state);
256 complete_task_(
ControlTask& task,
unsigned task_flags, ControlTask::State from_state);
261 bool process_tasks_();
Intrusive doubly-linked list.
Thread-safe lock-free node-based intrusive multi-producer single-consumer queue.
Base class for thread objects.
void wait(ControlTask &task)
Wait until the task is completed.
void schedule(ControlTask &task, IControlTaskExecutor &executor, IControlTaskCompleter *completer)
Enqueue a task for asynchronous execution as soon as possible.
virtual ~ControlTaskQueue()
Destroy.
void resume(ControlTask &task)
Resume task if it's paused.
void async_cancel(ControlTask &task)
Try to cancel scheduled task execution, if it's not executed yet.
bool is_valid() const
Check if the object was successfully constructed.
ControlTaskQueue()
Initialize.
void schedule_at(ControlTask &task, core::nanoseconds_t deadline, IControlTaskExecutor &executor, IControlTaskCompleter *completer)
Enqueue a task for asynchronous execution at given point of time.
void stop_and_wait()
Stop thread and wait until it terminates.
Base class for control tasks.
Control task completion handler.
Control task executor interface.
Control task completion handler.
Intrusive doubly-linked list.
Multi-producer single-consumer queue.
uint32_t seqlock_version_t
Type for holding seqlock value version. Version is changed each value update. May wrap.
int64_t nanoseconds_t
Nanoseconds.