VEXcode IQ C++ Unofficial documentation for version 3.0.4.1
Loading...
Searching...
No Matches
vex_thread.h File Reference

Header for thread control class (variation on tasks) More...

#include <chrono>

Go to the source code of this file.

Classes

class  vex::thread
 Use this class to create and control threads. More...
 
class  vex::mutex
 Use this class to create and control mutexes. More...
 

Namespaces

namespace  vex
 Bumper switch device class

 

Functions

int32_t vex::this_thread::get_id ()
 Gets the ID of the thread.
 
void vex::this_thread::yield ()
 Suspends the current thread.
 
void vex::this_thread::sleep_for (uint32_t time)
 sleep_for
 
template<typename _Rep , typename _Period >
void vex::this_thread::sleep_for (const std::chrono::duration< _Rep, _Period > &__rtime)
 Suspends the current thread until the time is expired in milliseconds.
 
void vex::this_thread::sleep_until (uint32_t time)
 sleep_until
 
template<typename _Clock , typename _Duration >
void vex::this_thread::sleep_until (const std::chrono::time_point< _Clock, _Duration > &__atime)
 Sleeps until the system timer reaches the time specified in the parameter.
 
void vex::this_thread::setPriority (int32_t priority)
 Sets the priority of the current thread.
 
int32_t vex::this_thread::priority ()
 Gets the priority of the current thread.
 

Detailed Description

Header for thread control class (variation on tasks)

Definition in file vex_thread.h.

Function Documentation

◆ get_id()

int32_t vex::this_thread::get_id ( )

Gets the ID of the thread.

Returns
Returns an integer that represents the thread's ID.

◆ priority()

int32_t vex::this_thread::priority ( )

Gets the priority of the current thread.

Returns
Returns the priority of the current thread as an integer.

◆ setPriority()

void vex::this_thread::setPriority ( int32_t priority)

Sets the priority of the current thread.

Parameters
priorityThe priority of the thread to be set to.

◆ sleep_for() [1/2]

template<typename _Rep , typename _Period >
void vex::this_thread::sleep_for ( const std::chrono::duration< _Rep, _Period > & __rtime)
inline

Suspends the current thread until the time is expired in milliseconds.

Parameters
rtimeThe standard chrono::duration object representing the time to sleep.

Definition at line 143 of file vex_thread.h.

◆ sleep_for() [2/2]

void vex::this_thread::sleep_for ( uint32_t time)

sleep_for

Suspends the current thread until the time is expired in milliseconds.

Parameters
timeThe amount of time for the thread to sleep.

◆ sleep_until() [1/2]

template<typename _Clock , typename _Duration >
void vex::this_thread::sleep_until ( const std::chrono::time_point< _Clock, _Duration > & __atime)
inline

Sleeps until the system timer reaches the time specified in the parameter.

Parameters
atimeThe standard chrono::time_point object representing the time to sleep.

Definition at line 163 of file vex_thread.h.

◆ sleep_until() [2/2]

void vex::this_thread::sleep_until ( uint32_t time)

sleep_until

Sleeps until the system timer reaches the time specified in the parameter.

Parameters
timeThe amount of time for the thread to sleep.