|
| Thread () |
| Create a new thread.
|
|
| Thread (Runnable &r) |
| Create a new thread which will execute the given Runnable.
|
|
virtual | ~Thread () |
| Destroy thread.
|
|
virtual void | run () |
| If this thread was constructed using a separate Runnable run object, then that Runnable object's run method is called; otherwise, this method does nothing and returns.
|
|
Runnable & | get_runnable () |
| Get the Runnable object used for thread execution.
|
|
void | join () |
| Waits for this thread to die.
|
|
void | start () |
| Causes this thread to begin execution; the system calls the run method of this thread.
|
|
void | set_stack_size (long s) |
| Before calling the start method this method can be used to change the stack size of the thread.
|
|
bool | is_alive () |
| Check whether thread is alive.
|
|
Thread * | clone () |
| Clone this thread.
|
|
| Synchronized () |
|
| ~Synchronized () |
|
void | wait () |
| Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.
|
|
bool | wait (unsigned long timeout) |
| Causes current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.
|
|
void | notify () |
| Wakes up a single thread that is waiting on this object's monitor.
|
|
void | notify_all () |
| Wakes up all threads that are waiting on this object's monitor.
|
|
bool | lock () |
| Enter a critical section.
|
|
TryLockResult | trylock () |
| Try to enter a critical section.
|
|
bool | unlock () |
| Leave a critical section.
|
|
| Runnable () |
|
virtual | ~Runnable () |
|
A thread is a thread of execution in a program.
There are two ways to create a new thread of execution. One is to declare a class to be a subclass of Thread. This subclass should override the run method of class Thread. An instance of the subclass can then be allocated and started.
The other way to create a thread is to declare a class that implements the Runnable interface. That class then implements the run method. An instance of the class can then be allocated, passed as an argument when creating Thread, and started.
- Author
- Frank Fock
- Version
- 3.5.7