|
Enumerated Type for thread scheduling policy |
|
|
Constructor |
|
Destructor |
|
Cancel the thread. Equivalent to SIGKILL.
|
|
Thread's cancel cleanup routine, called upon cancel(), after the cancelation has taken place, but before the thread exits completely. This method should be used to repair parts of the thread's data that may have been damaged by a pre-mature cancel. No-op by default. |
|
Return a pointer to the current running thread |
|
Detach the thread from the calling process.
|
|
Get the concurrency level for a running application. In this case, a return code of 0 means that the application is in default mode. A return code of -1 means that the application is incapable of setting an arbitrary concurrency, because it is a one-to-one execution model (sprocs, linuxThreads) |
|
|
|
This method will return the ThreadPriority of the master process. (ie, the one calling the thread->start() methods for the first time) The method will almost certainly return Thread::THREAD_PRIORITY_DEFAULT if Init() has not been called.
|
|
Get the thread's process id. This is the pthread_t or pid_t value depending on the threading model being used.
|
|
Get the thread's policy (if able)
|
|
Get the thread's schedule priority (if able)
|
|
Get the thread's desired stack size.
|
|
Get a unique thread id. This id is monotonically increasing.
|
|
Initialize Threading in a program. This method must be called before you can do any threading in a program. |
|
Query the thread's running status
|
|
Join the calling process with the thread
|
|
microSleep method, equivilant to the posix usleep(microsec). This is not strictly thread API but is used so often with threads. It's basically UNIX usleep. Parameter is number of microseconds we current thread to sleep. Returns 0 on succes, non-zero on failure (UNIX errno or GetLastError() will give detailed description. |
|
Print the thread's scheduling information to stdout. |
|
Thread's run method. Must be implemented by derived classes. This is where the action happens. |
|
Mark the thread to cancel aysncronously on Thread::cancel(). (May not be available with process-level implementations).
|
|
Mark the thread to cancel at the earliest convenience on Thread::cancel() (This is the default)
|
|
Disable thread cancelation altogether. Thread::cancel() has no effect.
|
|
Set the concurrency level for a running application. This method only has effect if the pthreads thread model is being used, and then only when that model is many-to-one (eg. irix). in other cases it is ignored. The concurrency level is only a *hint* as to the number of execution vehicles to use, the actual implementation may do anything it wants. Setting the value to 0 returns things to their default state.
|
|
Thread's processor affinity method. This binds a thread to a processor whenever possible. This call must be made before start() or startThread() and has no effect after the thread has been running. In the pthreads implementation, this is only implemented on sgi, through a pthread extension. On other pthread platforms this is ignored. Returns 0 on success, implementation's error on failure, or -1 if ignored. |
|
Set the thread's scheduling policy (if able)
|
|
Set the thread's schedule priority. This is a complex method. Beware of thread priorities when using a many-to-many kernel entity implemenation (such as IRIX pthreads). If one is not carefull to manage the thread priorities, a priority inversion deadlock can easily occur (Although the OpenThreads::Mutex & OpenThreads::Barrier constructs have been designed with this senario in mind). Unless you have explicit need to set the schedule pirorites for a given task, it is best to leave them alone.
|
|
Set the thread's desired stack size (in bytes). This method is an attribute of the thread and must be called *before* the start() method is invoked.
|
|
Start the thread. This method will configure the thread, set it's priority, and spawn it.
|
|
|
|
Test the cancel state of the thread. If the thread has been canceled this method will cause the thread to exit now. This method operates on the calling thread. Returns 0 if normal, -1 if called from a thread other that this. |
|
Yield the processor.
|
|
The Private Actions class is allowed to operate on private data. |