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 () |
|
|
|
Constructor (does not launch the thread; for that use start()).
|
|
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. |
|
Returns a string describing the thread.
|
|
|
|
Detaches a thread so that it never needs to be joined.
|
|
Blocks until the thread is finished. To be invoked only from a different thread than this one. |
|
Implemented in seda_clock_thread, and threaded< T >. |
|
Returns an object for the currently running thread.
|
|
|
|
Sleeps for a certain duration.
|
|
Starts the thread by invoking run() in the new thread.
|