VEX V5 C++ API
|
Use this class to create and control threads. More...
Public Member Functions | |
thread () | |
thread (void(*callback)(void)) | |
Creates a thread object. More... | |
~thread () | |
int32_t | get_id () |
Gets the ID of the thread. More... | |
void | join () |
Waits for the other thread to finish its execution. More... | |
bool | joinable () |
Permits the thread to execute from the thread handle. More... | |
void * | native_handle () |
Gets the pointer to the native handle of the thread. More... | |
void | swap (thread &__t) |
Swaps the thread IDs with another specified thread in the parameter. More... | |
void | interrupt () |
Stops the thread. More... | |
void | setPriority (int32_t priority) |
Sets the priority of the thread. More... | |
int32_t | priority () |
Gets the priority of the thread. More... | |
Static Public Member Functions | |
static int32_t | hardware_concurrency () |
Gets the number of concurrent threads supported by the harware. More... | |
static void | swap (thread &__x, thread &__y) |
Swaps two threads specified in the parameters. More... | |
Static Public Attributes | |
static const int32_t | threadPrioritylow = 1 |
static const int32_t | threadPriorityNormal = 7 |
static const int32_t | threadPriorityHigh = 15 |
Use this class to create and control threads.
vex::thread::thread | ( | ) |
vex::thread::thread | ( | void(*)(void) | callback | ) |
Creates a thread object.
callback | A reference to a function. |
vex::thread::~thread | ( | ) |
int32_t vex::thread::get_id | ( | ) |
Gets the ID of the thread.
void vex::thread::join | ( | ) |
Waits for the other thread to finish its execution.
bool vex::thread::joinable | ( | ) |
Permits the thread to execute from the thread handle.
Checks whether the thread is joinable.
void* vex::thread::native_handle | ( | ) |
Gets the pointer to the native handle of the thread.
void vex::thread::swap | ( | thread & | __t | ) |
Swaps the thread IDs with another specified thread in the parameter.
__t | The thread to swap to. |
void vex::thread::interrupt | ( | ) |
Stops the thread.
void vex::thread::setPriority | ( | int32_t | priority | ) |
Sets the priority of the thread.
priority | The priority of the thread to be set to. |
int32_t vex::thread::priority | ( | ) |
Gets the priority of the thread.
|
static |
Gets the number of concurrent threads supported by the harware.
Swaps two threads specified in the parameters.
__x | A thread to swap with the next thread set in the parameter. |
__y | A thread to swap with the previous thread set in the parameter. |
|
static |
|
static |
|
static |