activemq::concurrent::Thread Class Reference

#include <Thread.h>

Inheritance diagram for activemq::concurrent::Thread:

activemq::concurrent::Runnable activemq::concurrent::PooledThread List of all members.

Public Member Functions

 Thread ()
 Thread (Runnable *task)
virtual ~Thread ()
virtual void start () throw ( exceptions::ActiveMQException )
virtual void join () throw ( exceptions::ActiveMQException )
virtual void run ()

Static Public Member Functions

static void sleep (int millisecs)
static unsigned long getId (void)

Static Private Member Functions

static unsigned int WINAPI runCallback (void *param)

Private Attributes

Runnabletask
HANDLE threadHandle
bool started
bool joined

Detailed Description

Basic thread class - mimics the Java Thread. Derived classes may implement the run method, or this class can be used as is with a provided Runnable delegate.


Constructor & Destructor Documentation

Thread::Thread  ) 
 

default Constructor

Thread::Thread Runnable task  ) 
 

Constructor

Parameters:
task the Runnable that this thread manages

Thread::~Thread  )  [virtual]
 


Member Function Documentation

unsigned long Thread::getId void   )  [static]
 

Obtains the Thread Id of the current thread

Returns:
Thread Id

void Thread::join  )  throw ( exceptions::ActiveMQException ) [virtual]
 

Wait til the thread exits. This is when the run() method has returned or has thrown an exception.

virtual void activemq::concurrent::Thread::run void   )  [inline, virtual]
 

Default implementation of the run method - does nothing.

Implements activemq::concurrent::Runnable.

Reimplemented in activemq::concurrent::PooledThread.

unsigned int WINAPI Thread::runCallback void *  param  )  [static, private]
 

void Thread::sleep int  millisecs  )  [static]
 

Halts execution of the calling thread for a specified no of millisec.

Note that this method is a static method that applies to the calling thread and not to the thread object.

Parameters:
millisecs time in milliseconds to sleep

void Thread::start  )  throw ( exceptions::ActiveMQException ) [virtual]
 

Creates a system thread and starts it in a joinable mode. Upon creation, the run() method of either this object or the provided Runnable object will be invoked in the context of this thread.

Exceptions:
runtime_error is thrown if the system could not start the thread.


Member Data Documentation

bool activemq::concurrent::Thread::joined [private]
 

Indicates whether the thread has already been joined.

bool activemq::concurrent::Thread::started [private]
 

Started state of this thread.

Runnable* activemq::concurrent::Thread::task [private]
 

The task to be run by this thread, defaults to this thread object.

HANDLE activemq::concurrent::Thread::threadHandle [private]
 


The documentation for this class was generated from the following files:
Generated on Thu Aug 3 18:03:31 2006 for activemq-cpp by  doxygen 1.4.5