AIStatefulTask ‐ Asynchronous, Stateful Task Scheduler library. Threads-like task objects evolving through user-defined states. |
Modules | |
Going idle and waiting for an event. | |
Yield and engine control | |
Functions | |
void | AIStatefulTask::set_state (state_type new_state) |
void | AIStatefulTask::finish () |
utils::FuzzyBool | AIStatefulTask::is_self_locked (AIStatefulTaskMutex const &stateful_task_mutex, AIStatefulTaskMutexNode const *handle) |
From within the multiplex_impl
function of a running task, the following member functions may be called to control the task.
|
protected |
Mark that the task finished and schedule the call back.
A call to abort
and finish
will cause a task to not call multiplex_impl
again at all after leaving it (except when finish_impl
calls run
again, in which case the task is restarted from the beginning).
|
inlineprotected |
Return true when stateful_task_mutex is self locked.
handle must be the handle returned by AIStatefulTaskMutex::lock.
|
protected |
Set the state to run, the next invocation of multiplex_impl.
This function can be called from initialize_impl
and multiplex_impl
.
A call to set_state
has no immediate effect, except that the next invokation of multiplex_impl
will be with the state that was passed to the (last) call to set_state
.
new_state | The state to run the next invocation of multiplex_impl . |