![]() |
OpenZWave Library
1.4.3015
|
Implements a platform-independent thread management class. More...
#include <Thread.h>
Public Types | |
typedef void(* | pfnThreadProc_t) (Event *_exitEvent, void *_context) |
![]() | |
enum | { Timeout_Immediate = 0, Timeout_Infinite = -1 } |
typedef void(* | pfnWaitNotification_t) (void *_context) |
Public Member Functions | |
Thread (string const &_name) | |
bool | Start (pfnThreadProc_t _pfnThreadProc, void *_context) |
bool | Stop () |
void | Sleep (uint32 _millisecs) |
![]() | |
void | AddWatcher (pfnWaitNotification_t _callback, void *_context) |
void | RemoveWatcher (pfnWaitNotification_t _callback, void *_context) |
![]() | |
Ref () | |
void | AddRef () |
int32 | Release () |
Protected Member Functions | |
virtual bool | IsSignalled () |
virtual | ~Thread () |
![]() | |
Wait () | |
virtual | ~Wait () |
void | Notify () |
![]() | |
virtual | ~Ref () |
Additional Inherited Members | |
![]() | |
static int32 | Single (Wait *_object, int32 _timeout=-1) |
static int32 | Multiple (Wait **_objects, uint32 _numObjects, int32 _timeout=-1) |
Implements a platform-independent thread management class.
typedef void(* OpenZWave::Thread::pfnThreadProc_t) (Event *_exitEvent, void *_context) |
Thread::Thread | ( | string const & | _name | ) |
Constructor. Creates a thread object that can be used to serialize access to a shared resource.
|
protectedvirtual |
Destructor. Destroys the Thread object.
|
protectedvirtual |
Used by the Wait class to test whether the thread has been completed.
Implements OpenZWave::Wait.
void Thread::Sleep | ( | uint32 | _millisecs | ) |
Causes the thread to sleep for the specified number of milliseconds.
_millisecs | Number of milliseconds to sleep. |
bool Thread::Start | ( | pfnThreadProc_t | _pfnThreadProc, |
void * | _context | ||
) |
Start running a function on this thread. Attempts to start a function running on this thread. The call will fail if another function is already running.
_pThreadProc | pointer to the function to be run. The function must take a single void pointer as its only argument, and return void. On entry, the pointer will be set to the context provided to this Start method. |
_context | pointer allowing any relevant data to be passed to the thread function. |
bool Thread::Stop | ( | ) |
Stop a function running on this thread. Attempts to stop a function running on this thread. The call will fail if no function is running.