Use this class to create and control threads.
More...
#include <vex_thread.h>
|
| thread (int(*callback)(void)) |
| Creates a thread object.
|
|
| thread (void(*callback)(void)) |
| Creates a thread object.
|
|
int32_t | get_id () |
| Gets the ID of the thread.
|
|
void | join () |
| Waits for the other thread to finish its execution.
|
|
void | detach () |
| Permits the thread to execute from the thread handle.
|
|
bool | joinable () |
| Checks whether the thread is joinable.
|
|
void * | native_handle () |
| Gets the pointer to the native handle of the thread.
|
|
void | swap (thread &__t) |
| Swaps the thread IDs with another specified thread in the parameter.
|
|
void | interrupt () |
| Stops the thread.
|
|
void | setPriority (int32_t priority) |
| Sets the priority of the thread.
|
|
int32_t | priority () |
| Gets the priority of the thread.
|
|
|
static int32_t | hardware_concurrency () |
| Gets the number of concurrent threads supported by the hardware.
|
|
static void | swap (thread &__x, thread &__y) |
| Swaps two threads specified in the parameters.
|
|
Use this class to create and control threads.
Definition at line 28 of file vex_thread.h.
◆ thread() [1/3]
◆ thread() [2/3]
vex::thread::thread |
( |
int(* | callback )(void) | ) |
|
Creates a thread object.
- Parameters
-
callback | A reference to a function. |
◆ thread() [3/3]
vex::thread::thread |
( |
void(* | callback )(void) | ) |
|
|
inline |
Creates a thread object.
- Parameters
-
callback | A reference to a function. |
Definition at line 44 of file vex_thread.h.
◆ detach()
void vex::thread::detach |
( |
| ) |
|
|
inline |
Permits the thread to execute from the thread handle.
Definition at line 65 of file vex_thread.h.
◆ get_id()
int32_t vex::thread::get_id |
( |
| ) |
|
Gets the ID of the thread.
- Returns
- Returns an integer that represents the thread's ID.
◆ hardware_concurrency()
static int32_t vex::thread::hardware_concurrency |
( |
| ) |
|
|
static |
Gets the number of concurrent threads supported by the hardware.
- Returns
- An integer that represents the amount of concurrent threads supported by the hardware.
◆ joinable()
bool vex::thread::joinable |
( |
| ) |
|
Checks whether the thread is joinable.
- Returns
- Returns a true Boolean if the thread is joinable.
◆ priority()
int32_t vex::thread::priority |
( |
| ) |
|
Gets the priority of the thread.
- Returns
- Returns the priority of the thread as an integer.
◆ setPriority()
void vex::thread::setPriority |
( |
int32_t | priority | ) |
|
Sets the priority of the thread.
- Parameters
-
priority | The priority of the thread to be set to. |
◆ swap() [1/2]
void vex::thread::swap |
( |
thread & | __t | ) |
|
Swaps the thread IDs with another specified thread in the parameter.
- Parameters
-
◆ swap() [2/2]
static void vex::thread::swap |
( |
thread & | __x, |
|
|
thread & | __y ) |
|
inlinestatic |
Swaps two threads specified in the parameters.
- 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. |
Definition at line 114 of file vex_thread.h.
◆ threadPriorityHigh
const int32_t vex::thread::threadPriorityHigh = 15 |
|
static |
◆ threadPrioritylow
const int32_t vex::thread::threadPrioritylow = 1 |
|
static |
◆ threadPriorityNormal
const int32_t vex::thread::threadPriorityNormal = 7 |
|
static |
The documentation for this class was generated from the following file: