Om
1.0.0
A universal framework for multimedia simulation
|
A class that provides a function-based interface for creating threads. More...
#include <omThread.h>
Classes | |
class | ReturnValueWrapper |
A class that is used to facilitate accessing the return values of function threads. More... | |
class | ReturnValueWrapper< Sig, void > |
A class specialization that is used to handle void return values of function threads. More... | |
Public Member Functions | |
FunctionThread () | |
Create a default thread with no runnable to execute. More... | |
~FunctionThread () | |
Destroy and clean up the thread, stopping it if necessary. More... | |
void | start (const lang::FunctionCall< Signature > &functionCall) |
Start the execution of a thread using the specified function call. More... | |
lang::Optional< typename lang::FunctionCall< Signature >::ReturnType > | join () |
Public Member Functions inherited from om::threads::ThreadBase | |
ThreadBase () | |
Create a default thread that is not yet running. More... | |
ThreadBase (const ThreadBase &other) | |
Create a new thread that is a copy of another thread. More... | |
virtual | ~ThreadBase () |
Destroy this thread object. More... | |
ThreadBase & | operator= (const ThreadBase &other) |
Copy the attributes of one thread to this thread. More... | |
Bool | stop () |
Forcibly end the execution of a thread. More... | |
Bool | isRunning () const |
Get whether or not a thread is currently running. More... | |
ThreadID | getID () const |
Return the ID of this thread. More... | |
ThreadPriority | getPriority (const ThreadPriority &newPriority) |
Return an object describing the current scheduling priority for this thread. More... | |
Bool | setPriority (const ThreadPriority &newPriority) |
Set the scheduling priority for this thread. More... | |
Static Public Member Functions | |
static void | sleep (int milliseconds) |
Sleep the calling thread for the specified number of milliseconds. More... | |
static void | sleep (double seconds) |
Sleep the calling thread for the specified number of seconds. More... | |
static void | yield () |
Relinquish the calling thread's CPU time until it's rescheduled. More... | |
static void | exit () |
Terminate the current calling thread. More... | |
Static Public Member Functions inherited from om::threads::ThreadBase | |
static void | sleepMs (UInt milliseconds) |
Sleep the calling thread for the specified number of milliseconds. More... | |
static void | sleep (double seconds) |
Sleep this thread for the specified number of seconds. More... | |
static void | yield () |
Relinquish the calling thread's CPU time until is it rescheduled. More... | |
static void | exit () |
Terminate the current calling thread. More... | |
static ThreadID | getCurrentID () |
Return the ID of the calling thread. More... | |
Protected Member Functions | |
virtual void | run () |
Start the execution of subclass client code on a new thread. More... | |
Protected Member Functions inherited from om::threads::ThreadBase | |
Bool | startThread () |
Start this thread object's execution. More... | |
Bool | joinThread () |
Wait indefinitely to join a thread when it dies. More... | |
A class that provides a function-based interface for creating threads.
|
inline |
Create a default thread with no runnable to execute.
|
inline |
Destroy and clean up the thread, stopping it if necessary.
|
inline |
Start the execution of a thread using the specified function call.
This method creates a new thread if the thread is not already running and calls the specified function call object. When the function call returns, the thread exits.
functionCall | - a function call that should be executed on the other thread. |
|
inline |
|
inlinestatic |
Sleep the calling thread for the specified number of milliseconds.
|
inlinestatic |
Sleep the calling thread for the specified number of seconds.
|
inlinestatic |
Relinquish the calling thread's CPU time until it's rescheduled.
|
inlinestatic |
Terminate the current calling thread.
|
inlineprotectedvirtual |
Start the execution of subclass client code on a new thread.
Implements om::threads::ThreadBase.