Rudiments
|
#include <thread.h>
Inherits object.
Public Member Functions | |
thread () | |
virtual | ~thread () |
bool | setStackSize (size_t stacksize) |
bool | getStackSize (size_t *stacksize) |
bool | spawn (void *(*function)(void *), void *arg, bool detached) |
void | exit (int32_t *status) |
bool | wait (int32_t *status) |
bool | detach () |
bool | raiseSignal (int32_t signum) |
void | setRetryFailedSpawn (bool retry) |
bool | getRetryFailedSpawn () |
Public Member Functions inherited from object | |
virtual | ~object () |
Static Public Member Functions | |
static bool | isSupported () |
static bool | isReliable () |
The thread class provides a simple thread implementation.
thread::thread | ( | ) |
Creates an instance of the thread class.
|
virtual |
Deletes this instance of the thread class.
bool thread::detach | ( | ) |
Detaches the thread so that it may exit without calling exit() and without another thread needing to call wait(). Returns true on success and false if an error occurred.
bool thread::getRetryFailedSpawn | ( | ) |
Returns true if failed spawn() calls will be retried and false otherwise.
Sets "stacksize" to this thread's stack size. Returns true on success and false if an error occurred.
Returns true if the platform supports threads, and rudiments was built with thread support, and this platform's thread implementation is bellieved to be reliable.
Returns false if the platform doesn't support threads, rudiments was not built with thread support, or this platform's thread implementation is bellieved to be unreliable.
Returns true if the platform supports threads and rudiments was built with thread support and false otherwise.
See also: isReliable().
Sets this thread's stack size to "stacksize". Returns true on success and false if an error occurred.
Starts a new thread by running whatever function was set by the setFunction() method and passing that function whatever argument was set by the setArgument() method. Returns true on success and false if an error occurred.