15 m_suspendedOnPurpose(false)
21 if (handle ==
nullptr) {
33 this->m_identifier = identifier;
35 if (Task::s_taskRegistry) {
36 Task::s_taskRegistry->addTask(
this);
54 if (Task::s_taskRegistry) {
55 Task::s_taskRegistry->removeTask(
this);
61 reinterpret_cast<BareTaskHandle*
>(this->m_handle)->m_enabled =
false;
66 reinterpret_cast<BareTaskHandle*
>(this->m_handle)->m_enabled =
true;
71 return !
reinterpret_cast<BareTaskHandle*
>(this->m_handle)->m_enabled;
PlatformPointerCastType POINTER_CAST
PlatformUIntType NATIVE_UINT_TYPE
bool m_enabled
Save the priority.
Task::taskRoutine m_routine
Argument input pointer.
NATIVE_INT_TYPE m_priority
Function passed into the task.
static TaskStatus delay(NATIVE_UINT_TYPE msecs)
delay the task
virtual ~Task()
destructor
bool isSuspended()
check with OS to see if it is suspended already
void suspend(bool onPurpose=false)
suspend task
TaskStatus join(void **value_ptr)
Wait for task to finish.
@ TASK_OK
message sent/received okay
@ TASK_DELAY_ERROR
error trying to delay the task
@ TASK_UNKNOWN_ERROR
unexpected error return value
void resume()
resume execution of task
TaskStatus start(const Fw::StringBase &name, taskRoutine routine, void *arg, NATIVE_UINT_TYPE priority=TASK_DEFAULT, NATIVE_UINT_TYPE stackSize=TASK_DEFAULT, NATIVE_UINT_TYPE cpuAffinity=TASK_DEFAULT, NATIVE_UINT_TYPE identifier=TASK_DEFAULT)
start the task