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