STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
thread Class Reference

Classes

class  id
 

Public Types

typedef voidnative_handle_type
 

Public Member Functions

 thread () _NOEXCEPT
 
template<class _Fn , class... _Args>
 thread (_Fn &&_Fx, _Args &&..._Ax)
 
 ~thread () _NOEXCEPT
 
 thread (thread &&_Other) _NOEXCEPT
 
threadoperator= (thread &&_Other) _NOEXCEPT
 
 thread (const thread &)=delete
 
threadoperator= (const thread &)=delete
 
void swap (thread &_Other) _NOEXCEPT
 
bool joinable () const _NOEXCEPT
 
void join ()
 
void detach ()
 
id get_id () const _NOEXCEPT
 
native_handle_type native_handle ()
 

Static Public Member Functions

static unsigned int hardware_concurrency () _NOEXCEPT
 

Private Member Functions

thread_Move_thread (thread &_Other)
 

Private Attributes

_Thrd_t _Thr
 

Member Typedef Documentation

Constructor & Destructor Documentation

thread::thread ( )
inline
39  { // construct with no thread
41  }
_Thrd_t _Thr
Definition: thread:115
#define _Thr_set_null(thr)
Definition: xthrcommon.h:41
template<class _Fn , class... _Args>
thread::thread ( _Fn &&  _Fx,
_Args &&...  _Ax 
)
inlineexplicit
46  { // construct with _Fx(_Ax...)
47  _Launch(&_Thr,
48  _STD bind(_Decay_copy(_STD forward<_Fn>(_Fx)),
49  _Decay_copy(_STD forward<_Args>(_Ax))...));
50  }
void _Launch(_Thrd_t *_Thr, _Target &&_Tg)
Definition: xthread:203
_Thrd_t _Thr
Definition: thread:115
thread::~thread ( )
inline
54  { // clean up
55  if (joinable())
56  _XSTD terminate();
57  }
void __CRTDECL terminate()
Definition: exception:303
#define _XSTD
Definition: xstddef:20
bool joinable() const _NOEXCEPT
Definition: thread:78
thread::thread ( thread &&  _Other)
inline
60  : _Thr(_Other._Thr)
61  { // move from _Other
62  _Thr_set_null(_Other._Thr);
63  }
_Thrd_t _Thr
Definition: thread:115
#define _Thr_set_null(thr)
Definition: xthrcommon.h:41
thread::thread ( const thread )
delete

Member Function Documentation

thread& thread::_Move_thread ( thread _Other)
inlineprivate
107  { // move from _Other
108  if (joinable())
109  _XSTD terminate();
110  _Thr = _Other._Thr;
111  _Thr_set_null(_Other._Thr);
112  return (*this);
113  }
void __CRTDECL terminate()
Definition: exception:303
#define _XSTD
Definition: xstddef:20
bool joinable() const _NOEXCEPT
Definition: thread:78
_Thrd_t _Thr
Definition: thread:115
#define _Thr_set_null(thr)
Definition: xthrcommon.h:41
void thread::detach ( )
inline
86  { // detach thread
87  if (!joinable())
91  }
Definition: xthread:19
_CRTIMP2_PURE void __cdecl _Throw_Cpp_error(int code)
bool joinable() const _NOEXCEPT
Definition: thread:78
int _Thrd_detachX(_Thrd_t _Thr)
Definition: xthread:51
_Thrd_t _Thr
Definition: thread:115
#define _Thr_set_null(thr)
Definition: xthrcommon.h:41
thread::id thread::get_id ( ) const
inline
220  { // return id for this thread
221  return (id(*this));
222  }
static unsigned int thread::hardware_concurrency ( )
inlinestatic
96  { // return number of hardware thread contexts
98  }
unsigned int _CRTIMP __cdecl _GetConcurrency()
Returns the hardware concurrency available to the Concurrency Runtime, taking into account process af...
void thread::join ( )
inline
207  { // join thread
208  if (!joinable())
210  if (_Thr_is_null(_Thr))
212  if (get_id() == _STD this_thread::get_id())
214  if (_Thrd_join(_Thr, 0) != _Thrd_success)
217  }
Definition: xthread:19
#define _Thr_is_null(thr)
Definition: xthrcommon.h:42
_CRTIMP2_PURE int __cdecl _Thrd_join(_Thrd_t, int *)
_CRTIMP2_PURE void __cdecl _Throw_Cpp_error(int code)
bool joinable() const _NOEXCEPT
Definition: thread:78
Definition: xthreads.h:17
Definition: xthread:20
Definition: xthread:23
id get_id() const _NOEXCEPT
Definition: thread:219
_Thrd_t _Thr
Definition: thread:115
thread::id get_id() _NOEXCEPT
Definition: thread:224
#define _Thr_set_null(thr)
Definition: xthrcommon.h:41
bool thread::joinable ( ) const
inline
79  { // return true if this thread can be joined
80  return (!_Thr_is_null(_Thr));
81  }
#define _Thr_is_null(thr)
Definition: xthrcommon.h:42
_Thrd_t _Thr
Definition: thread:115
native_handle_type thread::native_handle ( )
inline
101  { // return Win32 HANDLE as void *
102  return (_Thr._Hnd);
103  }
void * _Hnd
Definition: xthrcommon.h:36
_Thrd_t _Thr
Definition: thread:115
thread& thread::operator= ( thread &&  _Other)
inline
66  { // move from _Other
67  return (_Move_thread(_Other));
68  }
thread & _Move_thread(thread &_Other)
Definition: thread:106
thread& thread::operator= ( const thread )
delete
void thread::swap ( thread _Other)
inline
74  { // swap with _Other
75  _STD swap(_Thr, _Other._Thr);
76  }
void swap(thread &_Other) _NOEXCEPT
Definition: thread:73
_Thrd_t _Thr
Definition: thread:115

Member Data Documentation

_Thrd_t thread::_Thr
private

The documentation for this class was generated from the following file: