Wrapper class for posix threads. More...
#include <SickThread.hpp>
Public Member Functions | |
void | join () |
SickThread () | |
virtual | ~SickThread () |
Public Member Functions inherited from ThreadWrapperBase | |
pthread_t * | get_thread_id () |
bool | isRunning () |
void | join () |
void | run (void *classptr) |
ThreadWrapperBase () | |
virtual | ~ThreadWrapperBase () |
Public Attributes | |
bool | m_threadShouldRun |
Private Member Functions | |
void | thread_entry () |
Additional Inherited Members | |
Protected Attributes inherited from ThreadWrapperBase | |
void * | pthis |
Wrapper class for posix threads.
Usage: Using object must create an instance of this class, and then call start() with its callback function as argument (see start() for more details). To stop the thread execution, call stop().
Setting the parameter m_beVerbose to true (e.g. via enableVerboseDebugOutput in function start()) will turn on very verbose output that should be useful for debugging.
The thread callback function itself has 2 parameters:
endThisThread: A bool flag that may be set by the callback function to "false" in case the thread function decides this thread needs to end.
sleepTimeMs: The sleep time, in ms, that will be spent between subsequent calls to the callback function. Default is 10 ms, but other times may be set. Note that not all operating systems may be able to schedule very short sleep times.
Definition at line 80 of file SickThread.hpp.
|
inline |
Definition at line 105 of file SickThread.hpp.
|
inlinevirtual |
Definition at line 106 of file SickThread.hpp.
|
inline |
Definition at line 99 of file SickThread.hpp.
|
inlineprivatevirtual |
Implements ThreadWrapperBase.
Definition at line 82 of file SickThread.hpp.
bool SickThread< T, M >::m_threadShouldRun |
Definition at line 106 of file SickThread.hpp.