AIStatefulTask ‐ Asynchronous, Stateful Task Scheduler library.

Threads-like task objects evolving through user-defined states.

Modules | Functions
Protected control functions.
Collaboration diagram for Protected control functions.:


 Going idle and waiting for an event.
 Yield and engine control


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)

Detailed Description

From within the multiplex_impl function of a running task, the following member functions may be called to control the task.

See also
Public control functions.

Function Documentation

◆ finish()

void AIStatefulTask::finish ( )

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).

◆ is_self_locked()

utils::FuzzyBool AIStatefulTask::is_self_locked ( AIStatefulTaskMutex const &  stateful_task_mutex,
AIStatefulTaskMutexNode const *  handle 

Return true when stateful_task_mutex is self locked.

handle must be the handle returned by AIStatefulTaskMutex::lock.

◆ set_state()

void AIStatefulTask::set_state ( state_type  new_state)

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_stateThe state to run the next invocation of multiplex_impl.