|
Rudiments
|
Public Member Functions | |
| thread () | |
| virtual | ~thread () |
| void | setFunction (void *(*function)(void *), void *arg) |
| bool | setStackSize (size_t stacksize) |
| bool | getStackSize (size_t *stacksize) |
| bool | create () |
| void | exit (int32_t *status) |
| bool | join (int32_t *status) |
| bool | detach () |
| bool | cancel () |
| bool | raiseSignal (int32_t signum) |
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::cancel | ( | ) |
Cancels execution of the thread.
| bool thread::create | ( | ) |
Starts a new thread by running whatever function was set by the setFunction() method. Returns true on success and false if an error occurred.
| bool thread::detach | ( | ) |
| void thread::exit | ( | int32_t * | status | ) |
| 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 create() 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::setFunction | ( | void *(*)(void *) | function, |
| void * | arg | ||
| ) |
Defines the function that will be run when create() 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.
1.8.6