µOS++ IIIe Reference  v6.3.15
“Perfekt ist nicht gut genug”
The third edition of µOS++, a POSIX inspired open source system, written in C++.
os::estd::this_thread Namespace Reference

A namespace for functions applying to the current thread. More...

Functions

thread::id get_id () noexcept
 Return the id of the current running thread. More...
 
template<typename Clock_T = os::estd::chrono::systick_clock, typename Rep_T , typename Period_T >
constexpr void sleep_for (const std::chrono::duration< Rep_T, Period_T > &rel_time)
 Sleep for a given duration. More...
 
template<typename Clock_T , typename Duration_T >
void sleep_until (const std::chrono::time_point< Clock_T, Duration_T > &abs_time)
 Sleep until a given time point. More...
 
template<typename Duration_T >
void sleep_until (const std::chrono::time_point< os::estd::chrono::realtime_clock, Duration_T > &abs_time)
 
template<typename Duration_T >
void sleep_until (const std::chrono::time_point< os::estd::chrono::systick_clock, Duration_T > &abs_time)
 
void yield () noexcept
 Yield the CPU to the next ready thread. More...
 

Detailed Description

A namespace for functions applying to the current thread.

Function Documentation

◆ get_id()

thread::id os::estd::this_thread::get_id ( )
inlinenoexcept

Return the id of the current running thread.

Definition at line 403 of file thread.

◆ sleep_for()

template<typename Clock_T = os::estd::chrono::systick_clock, typename Rep_T , typename Period_T >
constexpr void os::estd::this_thread::sleep_for ( const std::chrono::duration< Rep_T, Period_T > &  rel_time)

Sleep for a given duration.

Parameters
[in]rel_time

extra Clock_T is an extension to the standard

Definition at line 458 of file thread.

◆ sleep_until() [1/3]

template<typename Clock_T , typename Duration_T >
void os::estd::this_thread::sleep_until ( const std::chrono::time_point< Clock_T, Duration_T > &  abs_time)

Sleep until a given time point.

Parameters
[in]abs_time

Definition at line 478 of file thread.

◆ sleep_until() [2/3]

template<typename Duration_T >
void os::estd::this_thread::sleep_until ( const std::chrono::time_point< os::estd::chrono::realtime_clock, Duration_T > &  abs_time)

Definition at line 499 of file thread.

◆ sleep_until() [3/3]

template<typename Duration_T >
void os::estd::this_thread::sleep_until ( const std::chrono::time_point< os::estd::chrono::systick_clock, Duration_T > &  abs_time)

Definition at line 523 of file thread.

◆ yield()

void os::estd::this_thread::yield ( void  )
inlinenoexcept

Yield the CPU to the next ready thread.

Yield the CPU to the next ready thread.

Parameters
None.
Returns
Nothing.

Pass control to next thread that is in READY state.

Warning
Cannot be invoked from Interrupt Service Routines.

Definition at line 397 of file thread.