CVD 0.8
|
The Thread class encapsulates a thread of execution. More...
#include <thread.h>
Public Member Functions | |
Thread () | |
virtual | ~Thread () |
void | start (Runnable *runnable=0) |
void | stop () |
bool | shouldStop () const |
bool | isRunning () const |
void | join () |
pthread_t | getID () |
virtual void | run () |
Static Public Member Functions | |
static unsigned int | count () |
static Thread * | getCurrent () |
static void | sleep (unsigned int milli) |
static void | yield () |
The Thread class encapsulates a thread of execution.
It is implemented with POSIX threads. Code that uses this class should link with libpthread and librt (for nanosleep).
void CVD::Thread::stop | ( | ) |
Tell the thread to stop.
This doesn't make the thread actually stop, it just causes shouldStop() to return true.
void CVD::Thread::join | ( | ) |
This blocks until the thread has actually terminated.
If the thread is infinite looping, this will block forever!