39 #ifndef _PLT_THREADTASK_H_ 40 #define _PLT_THREADTASK_H_ 74 return NPT_SUCCEEDED(m_Abort.WaitUntilEquals(1, timeout));
86 bool auto_destroy =
true);
91 NPT_Result
Stop(
bool blocking =
true);
122 NPT_Result StartThread();
Definition: NptThreads.h:234
virtual void DoInit()
This method to override in derived classes is called when the task is about to start.
Definition: PltThreadTask.h:97
NPT_Result Start(PLT_TaskManager *task_manager=NULL, NPT_TimeInterval *delay=NULL, bool auto_destroy=true)
Start a task by associating it with a task manager.
Definition: PltThreadTask.cpp:65
Definition: NptThreads.h:209
~PLT_ThreadTask() override
The task manager will destroy the task when finished if m_AutoDestroy is true otherwise the owner of ...
Definition: PltThreadTask.cpp:56
virtual void DoAbort()
This method to override in derived classes is called when the task is about to stop.
Definition: PltThreadTask.h:103
NPT_Result Stop(bool blocking=true)
Stop the task.
Definition: PltThreadTask.cpp:116
The PLT_TaskManager class maintains a list of runnable tasks.
Definition: PltTaskManager.h:60
Definition: NptThreads.h:149
virtual void DoRun()
This method to override in derived classes is the main task loop.
Definition: PltThreadTask.h:108
virtual bool IsAborting(NPT_Timeout timeout)
Return whether this task is in the process of stopping.
Definition: PltThreadTask.h:73
NPT_Result Kill()
When a task is not managed by a PLT_TaskManager, the owner must call this to stop and destroy it...
Definition: PltThreadTask.cpp:139
PLT_ThreadTask()
A PLT_ThreadTask base class is never instantiated directly.
Definition: PltThreadTask.cpp:46
The PLT_ThreadTask class is a base class for executing a given task in a worker thread.
Definition: PltThreadTask.h:56