CAPD::DynSys Library
6.0.0
|
This class is an abstract Task to be executed in a thread pool. More...
#include <capd/threading/ThreadPool.h>
Public Types | |
typedef std::unique_lock< std::mutex > | Lock |
Public Member Functions | |
Task (const Task &)=delete | |
Task () | |
virtual | ~Task () |
virtual void | run (unsigned threadId)=0 |
void | join () |
wait for task completion More... | |
void | execute (unsigned threadId) |
This method can be invoked by the user but it is recomended to run tasks through a ThreadPool instance. More... | |
Static Public Member Functions | |
template<class F > | |
static LambdaTask< F > * | createFromLambda (F &f) |
This class is an abstract Task to be executed in a thread pool.
An inheriting class should override the method run which will be exectued in the task.
An instance of processed task should exists until the thread pool to which the task is submitted completes the executon of the task or until the pool has been interrupted. Otherwise the behaviour is undefined.
typedef std::unique_lock<std::mutex> capd::threading::Task::Lock |
|
delete |
|
inline |
|
inlinevirtual |
|
inline |
This method can be invoked by the user but it is recomended to run tasks through a ThreadPool instance.
|
inline |
wait for task completion
|
pure virtual |
Implemented in capd::threading::LambdaTask< F >.