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

thread Class Reference

Inherited by seda_clock_thread, seda_stage< 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 (ntime 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 ntime    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:10 2002 for NMSTL