StormByte 3.0.0
C++26 foundation of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Safe::this_thread Namespace Reference

Operations on the calling execution. More...

Functions

Thread::Id get_id () noexcept
 Identifier of the calling execution.
void yield () noexcept
 Offer the calling execution.
template<class Rep, class Period>
STORMBYTE_FORCE_INLINE void sleep_for (const std::chrono::duration< Rep, Period > &time) noexcept
 Sleep the calling execution.
template<class Clock, class Duration>
STORMBYTE_FORCE_INLINE void sleep_until (const std::chrono::time_point< Clock, Duration > &time) noexcept
 Sleep until a time point.

Detailed Description

Operations on the calling execution.

The names match std::this_thread.

Function Documentation

◆ get_id()

Thread::Id StormByte::Safe::this_thread::get_id ( )
inlinenoexcept

Identifier of the calling execution.

Returns
Non-zero identifier.

◆ sleep_for()

template<class Rep, class Period>
STORMBYTE_FORCE_INLINE void StormByte::Safe::this_thread::sleep_for ( const std::chrono::duration< Rep, Period > & time)
noexcept

Sleep the calling execution.

Template Parameters
RepDuration representation.
PeriodDuration period.
Parameters
timeDuration. A negative duration returns immediately.

◆ sleep_until()

template<class Clock, class Duration>
STORMBYTE_FORCE_INLINE void StormByte::Safe::this_thread::sleep_until ( const std::chrono::time_point< Clock, Duration > & time)
noexcept

Sleep until a time point.

Template Parameters
ClockClock.
DurationDuration.
Parameters
timeAbsolute time.

◆ yield()

void StormByte::Safe::this_thread::yield ( )
inlinenoexcept

Offer the calling execution.