µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
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.
 
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.
 
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.
 
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.
 

Detailed Description

A namespace for functions applying to the current thread.

Function Documentation

◆ get_id()

thread::id this_thread::get_id ( )
inlinenoexcept

Return the id of the current running thread.

Definition at line 410 of file thread_internal.h.

◆ sleep_for()

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

Sleep for a given duration.

Parameters
[in]rel_timesleep duration.

extra Clock_T is an extension to the standard

Definition at line 472 of file thread_internal.h.

◆ sleep_until() [1/3]

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

Sleep until a given time point.

Parameters
[in]abs_timeAbsolute time point.

Definition at line 492 of file thread_internal.h.

◆ sleep_until() [2/3]

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

Definition at line 516 of file thread_internal.h.

◆ sleep_until() [3/3]

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

Definition at line 543 of file thread_internal.h.

◆ yield()

void this_thread::yield ( void  )
inlinenoexcept

Yield the CPU to the next ready thread.

Definition at line 398 of file thread_internal.h.