![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
#include <FXThread.h>
Subclasses must implement the run() function do implement the desired functionality of the thread. The storage of the FXThread object is to be managed by the calling thread, not by the thread itself.
Thread priority levels.
enum FX::FXThread::Policy |
FX::FXThread::FXThread | ( | ) |
Initialize thread object.
virtual FX::FXThread::~FXThread | ( | ) | [virtual] |
Destroy the thread immediately, running or not.
It is probably better to wait until it is finished, in case the thread currently holds mutexes.
FXThreadID FX::FXThread::id | ( | ) | const |
Return handle of this thread object.
This handle is valid in the context of the thread which called start().
FXbool FX::FXThread::running | ( | ) | const |
Return true if this thread is running.
FXbool FX::FXThread::start | ( | unsigned long | stacksize = 0 |
) |
Start thread; the thread is started as attached.
The thread is given stacksize for its stack; a value of zero for stacksize will give it the default stack size. This invokes the run() function in the context of the new thread.
FXbool FX::FXThread::join | ( | ) |
Suspend calling thread until thread is done.
The FXThreadID is reset back to zero.
FXbool FX::FXThread::cancel | ( | ) |
Cancel the thread, stopping it immediately, running or not.
If the calling thread is this thread, nothing happens. It is probably better to wait until it is finished, in case the thread currently holds mutexes. The FXThreadID is reset back to zero after the thread has been stopped.
FXbool FX::FXThread::detach | ( | ) |
Detach thread, so that a no join() is necessary to harvest the resources of this thread.
The thread continues to run until normal completion.
static void FX::FXThread::exit | ( | FXint | code = 0 |
) | [static] |
Exit the calling thread.
No destructors are invoked for objects on thread's stack; to invoke destructors, throw an exception instead.
static void FX::FXThread::yield | ( | ) | [static] |
Make the thread yield its time quantum.
static FXTime FX::FXThread::time | ( | ) | [static] |
Return time in nanoseconds since Epoch (Jan 1, 1970).
static void FX::FXThread::sleep | ( | FXTime | nsec | ) | [static] |
Make the calling thread sleep for a number of nanoseconds.
static void FX::FXThread::wakeat | ( | FXTime | nsec | ) | [static] |
Wake at appointed time specified in nanoseconds since Epoch.
static FXThread* FX::FXThread::self | ( | ) | [static] |
Return pointer to the FXThread instance associated with the calling thread; it returns NULL for the main thread and all threads not created by FOX.
static FXThreadID FX::FXThread::current | ( | ) | [static] |
Return thread id of calling thread.
static FXint FX::FXThread::processors | ( | ) | [static] |
Return number of available processors in the system.
static FXThreadStorageKey FX::FXThread::createStorageKey | ( | ) | [static] |
Generate new thread local storage key.
static void FX::FXThread::deleteStorageKey | ( | FXThreadStorageKey | key | ) | [static] |
Dispose of thread local storage key.
static void* FX::FXThread::getStorage | ( | FXThreadStorageKey | key | ) | [static] |
Get thread local storage pointer using key.
static void FX::FXThread::setStorage | ( | FXThreadStorageKey | key, | |
void * | ptr | |||
) | [static] |
Set thread local storage pointer using key.
Priority FX::FXThread::priority | ( | ) | const |
Return thread scheduling priority.
Policy FX::FXThread::policy | ( | ) | const |
Get thread scheduling policy.
FXbool FX::FXThread::suspend | ( | ) |
Suspend thread; return true if success.
FXbool FX::FXThread::resume | ( | ) |
Resume thread; return true if success.
![]() |