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
205  { // return id for current thread
206  return (_Thrd_id());
207  }
_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
135  { // sleep for duration
136  stdext::threads::xtime _Tgt = _To_xtime(_Rel_time);
138  }
xtime _To_xtime(const chrono::duration< _Rep, _Period > &_Rel_time)
Definition: chrono:1014
struct xtime xtime
void sleep_until(const stdext::threads::xtime *_Abs_time)
Definition: thread:127
void this_thread::sleep_until ( const stdext::threads::xtime _Abs_time)
inline
128  { // sleep until _Abs_time
129  _Thrd_sleep(_Abs_time);
130  }
_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
144  { // sleep until time point
145  this_thread::sleep_for(_Abs_time.time_since_epoch() - _Clock::now().time_since_epoch());
146  }
void sleep_for(const chrono::duration< _Rep, _Period > &_Rel_time)
Definition: thread:134
constexpr _Duration time_since_epoch() const
Definition: chrono:256
void this_thread::yield ( )
inline
123  { // give up balance of time slice
124  _Thrd_yield();
125  }
_CRTIMP2_PURE void __cdecl _Thrd_yield(void)