Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Thread Class Reference

Inherited by seda_clock_thread, SEDAStage< In, void >::my_thread, and Threaded< T >.

List of all members.


Detailed Description

A Thread of control.


Public Types

typedef pthread_t id_type

Public Methods

 Thread (string name=string())
 Constructor (does not launch the Thread; for that use start()).

virtual ~Thread ()
 Destructor.

void start ()
 Starts the Thread by invoking run() in the new Thread.

void join ()
 Blocks until the Thread is finished.

void detach ()
 Detaches a Thread so that it never needs to be joined.

string as_string () const
 Returns a string describing the Thread.


Static Public Methods

id_type self_id ()
void sleep (Time duration)
 Sleeps for a certain duration.

Thread & self ()
 Returns an object for the currently running Thread.


Protected Methods

virtual void run ()=0
void delete_on_completion ()


Member Typedef Documentation

typedef pthread_t Thread::id_type
 


Constructor & Destructor Documentation

Thread::Thread string    name = string()
 

Constructor (does not launch the Thread; for that use start()).

virtual Thread::~Thread   [virtual]
 

Destructor.

Note that a Thread should never delete itself; it may invoke delete_on_completion() from within run() to cause it to be deleted once the run() method has returned.


Member Function Documentation

string Thread::as_string   const
 

Returns a string describing the Thread.

void Thread::delete_on_completion   [protected]
 

void Thread::detach  
 

Detaches a Thread so that it never needs to be joined.

void Thread::join  
 

Blocks until the Thread is finished.

To be invoked only from a different Thread than this one.

virtual void Thread::run   [protected, pure virtual]
 

Implemented in seda_clock_thread, and Threaded< T >.

Thread& Thread::self   [static]
 

Returns an object for the currently running Thread.

id_type Thread::self_id   [static]
 

void Thread::sleep Time    duration [static]
 

Sleeps for a certain duration.

void Thread::start  
 

Starts the Thread by invoking run() in the new Thread.


The documentation for this class was generated from the following file:
Generated on Fri Dec 20 13:35:11 2002 for NMSTL