A class that can be managed by another thread. More...
#include <yarp/os/Runnable.h>
Public Member Functions | |
virtual | ~Runnable () |
Destructor. More... | |
virtual void | run () |
Body to run - could be periodic or continuous. More... | |
virtual void | close () |
User-defined procedure for stopping execution. More... | |
virtual void | beforeStart () |
Should be called from the creator before the thread exists and before a call that requested the thread returns. More... | |
virtual void | afterStart (bool success) |
Should be called from the creator after the thread exists and before a call that requested the thread returns. More... | |
virtual bool | threadInit () |
Initialization method. More... | |
virtual void | threadRelease () |
Release method. More... | |
A class that can be managed by another thread.
Definition at line 31 of file Runnable.h.
|
virtualdefault |
Destructor.
|
virtual |
Should be called from the creator after the thread exists and before a call that requested the thread returns.
Definition at line 31 of file Runnable.cpp.
|
virtual |
Should be called from the creator before the thread exists and before a call that requested the thread returns.
Definition at line 27 of file Runnable.cpp.
|
virtual |
User-defined procedure for stopping execution.
There is no general-purpose way to achieve that.
Definition at line 23 of file Runnable.cpp.
|
virtual |
Body to run - could be periodic or continuous.
Definition at line 19 of file Runnable.cpp.
|
virtual |
Initialization method.
The thread executes this function when it starts and before "run". This is a good place to perform initialization tasks that need to be done by the thread itself (device drivers initialization, memory allocation etc). If the function returns false the thread quits and never calls "run". The return value of threadInit() is notified to the thread class and passed as a parameter to afterStart(). Note that afterStart() is called by the same thread that is executing the start method.
Definition at line 36 of file Runnable.cpp.
|
virtual |
Release method.
The thread executes this function once when it exits, after the last "run". This is a good place to release resources that were initialized in threadInit() (release memory, and device driver resources).
Definition at line 41 of file Runnable.cpp.