STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Functions
this_thread Namespace Reference

Functions

thread::id get_id () _NOEXCEPT
 
void yield () _NOEXCEPT
 
void sleep_until (const stdext::threads::xtime *_Abs_time)
 
template<class _Rep , class _Period >
void sleep_for (const chrono::duration< _Rep, _Period > &_Rel_time)
 
template<class _Clock , class _Duration >
void sleep_until (const chrono::time_point< _Clock, _Duration > &_Abs_time)
 

Function Documentation

thread::id this_thread::get_id ( )
inline
204  { // return id for current thread
205  return (_Thrd_id());
206  }
_CRTIMP2_PURE _Thrd_id_t __cdecl _Thrd_id(void)
template<class _Rep , class _Period >
void this_thread::sleep_for ( const chrono::duration< _Rep, _Period > &  _Rel_time)
inline
134  { // sleep for duration
135  stdext::threads::xtime _Tgt = _To_xtime(_Rel_time);
137  }
xtime _To_xtime(const chrono::duration< _Rep, _Period > &_Rel_time)
Definition: chrono:1018
struct xtime xtime
void sleep_until(const stdext::threads::xtime *_Abs_time)
Definition: thread:126
void this_thread::sleep_until ( const stdext::threads::xtime _Abs_time)
inline
127  { // sleep until _Abs_time
128  _Thrd_sleep(_Abs_time);
129  }
_CRTIMP2_PURE void __cdecl _Thrd_sleep(const xtime *)
template<class _Clock , class _Duration >
void this_thread::sleep_until ( const chrono::time_point< _Clock, _Duration > &  _Abs_time)
inline
143  { // sleep until time point
144  this_thread::sleep_for(_Abs_time.time_since_epoch() - _Clock::now().time_since_epoch());
145  }
void sleep_for(const chrono::duration< _Rep, _Period > &_Rel_time)
Definition: thread:133
constexpr _Duration time_since_epoch() const
Definition: chrono:252
void this_thread::yield ( )
inline
122  { // give up balance of time slice
123  _Thrd_yield();
124  }
_CRTIMP2_PURE void __cdecl _Thrd_yield(void)