Rudiments
|
Public Member Functions | |
thread () | |
virtual | ~thread () |
void | setFunction (void *(*function)(void *)) |
void | setArgument (void *arg) |
bool | setStackSize (size_t stacksize) |
bool | getStackSize (size_t *stacksize) |
bool | run () |
bool | run (void *arg) |
bool | runDetached () |
bool | runDetached (void *arg) |
void | exit (int32_t *status) |
bool | join (int32_t *status) |
bool | detach () |
bool | raiseSignal (int32_t signum) |
void | retryFailedRun () |
void | dontRetryFailedRun () |
bool | getRetryFailedRun () |
Static Public Member Functions | |
static bool | supportsThreads () |
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 | ( | ) |
void thread::dontRetryFailedRun | ( | ) |
void thread::exit | ( | int32_t * | status | ) |
bool thread::getRetryFailedRun | ( | ) |
Returns true if failed run() calls will be retried and false otherwise.
bool thread::getStackSize | ( | size_t * | stacksize | ) |
Sets "stacksize" to this thread's stack size. Returns true on success and false if an error occurred.
bool thread::join | ( | int32_t * | status | ) |
Waits for the function set by setFunction() and run by run() to call exit() or return. This method should be called by a second thread. If non-NULL, "status" will be set to the exit status of the thread. Returns true on success and false if an error occurred.
bool thread::raiseSignal | ( | int32_t | signum | ) |
Sends signal "signum" to the thread.
void thread::retryFailedRun | ( | ) |
bool thread::run | ( | ) |
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.
bool thread::run | ( | void * | arg | ) |
Starts a new thread by running whatever function was set by the setFunction() method, passing that function argument "arg". Returns true on success and false if an error occurred.
bool thread::runDetached | ( | ) |
Starts a new already-detached 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.
bool thread::runDetached | ( | void * | arg | ) |
Starts a new already-detached thread by running whatever function was set by the setFunction() method, passing that function argument "arg". Returns true on success and false if an error occurred.
void thread::setArgument | ( | void * | arg | ) |
Defines the argument that will be passed to the function when run() is called.
void thread::setFunction | ( | void *(*)(void *) | function | ) |
Defines the function that will be run when run() is called.
bool thread::setStackSize | ( | size_t | stacksize | ) |
Sets this thread's stack size to "stacksize". Returns true on success and false if an error occurred.
|
static |
Returns true if the platform supports threads and rudiments was built with thread support and false otherwise.