CVD 0.8
Public Member Functions | Static Public Member Functions
CVD::Thread Class Reference

The Thread class encapsulates a thread of execution. More...

#include <thread.h>

Inheritance diagram for CVD::Thread:

List of all members.

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 ThreadgetCurrent ()
static void sleep (unsigned int milli)
static void yield ()

Detailed Description

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).

Definition at line 13 of file thread.h.

Member Function Documentation

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!

The documentation for this class was generated from the following file: