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, class = typename enable_if< !is_same<typename decay<_Fn>::type, thread>::value>::type>
 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
37  { // construct with no thread
39  }
_Thrd_t _Thr
Definition: thread:116
#define _Thr_set_null(thr)
Definition: xthrcommon.h:42
template<class _Fn , class... _Args, class = typename enable_if< !is_same<typename decay<_Fn>::type, thread>::value>::type>
thread::thread ( _Fn &&  _Fx,
_Args &&...  _Ax 
)
inlineexplicit
47  { // construct with _Fx(_Ax...)
48  _Launch(&_Thr,
50  _STD forward<_Fn>(_Fx), _STD forward<_Args>(_Ax)...));
51  }
enable_if<!is_array< _Ty >::value, unique_ptr< _Ty > >::type make_unique(_Types &&..._Args)
Definition: memory:1628
void _Launch(_Thrd_t *_Thr, _Target &&_Tg)
Definition: xthread:257
typename decay< _Ty >::type decay_t
Definition: type_traits:1873
Definition: tuple:226
_Thrd_t _Thr
Definition: thread:116
thread::~thread ( )
inline
55  { // clean up
56  if (joinable())
57  _XSTD terminate();
58  }
#define _XSTD
Definition: xstddef:21
void __CRTDECL terminate() _NOEXCEPT
Definition: exception:208
bool joinable() const _NOEXCEPT
Definition: thread:79
thread::thread ( thread &&  _Other)
inline
61  : _Thr(_Other._Thr)
62  { // move from _Other
63  _Thr_set_null(_Other._Thr);
64  }
_Thrd_t _Thr
Definition: thread:116
#define _Thr_set_null(thr)
Definition: xthrcommon.h:42
thread::thread ( const thread )
delete

Member Function Documentation

thread& thread::_Move_thread ( thread _Other)
inlineprivate
108  { // move from _Other
109  if (joinable())
110  _XSTD terminate();
111  _Thr = _Other._Thr;
112  _Thr_set_null(_Other._Thr);
113  return (*this);
114  }
#define _XSTD
Definition: xstddef:21
void __CRTDECL terminate() _NOEXCEPT
Definition: exception:208
bool joinable() const _NOEXCEPT
Definition: thread:79
_Thrd_t _Thr
Definition: thread:116
#define _Thr_set_null(thr)
Definition: xthrcommon.h:42
void thread::detach ( )
inline
87  { // detach thread
88  if (!joinable())
92  }
bool joinable() const _NOEXCEPT
Definition: thread:79
int _Thrd_detachX(_Thrd_t _Thr)
Definition: xthread:53
Definition: xthread:21
_CRTIMP2_PURE void __cdecl _Throw_Cpp_error(int _Code)
_Thrd_t _Thr
Definition: thread:116
#define _Thr_set_null(thr)
Definition: xthrcommon.h:42
thread::id thread::get_id ( ) const
inline
200  { // return id for this thread
201  return (_Thr_val(_Thr));
202  }
#define _Thr_val(thr)
Definition: xthrcommon.h:41
_Thrd_t _Thr
Definition: thread:116
static unsigned int thread::hardware_concurrency ( )
inlinestatic
97  { // return number of hardware thread contexts
98  return (_Thrd_hardware_concurrency());
99  }
_CRTIMP2_PURE unsigned int __cdecl _Thrd_hardware_concurrency(void)
void thread::join ( )
inline
186  { // join thread
187  if (!joinable())
189  const bool _Is_null = _Thr_is_null(_Thr); // Avoid Clang -Wparentheses-equality
190  if (_Is_null)
192  if (get_id() == _STD this_thread::get_id())
194  if (_Thrd_join(_Thr, 0) != _Thrd_success)
197  }
#define _Thr_is_null(thr)
Definition: xthrcommon.h:43
_CRTIMP2_PURE int __cdecl _Thrd_join(_Thrd_t, int *)
bool joinable() const _NOEXCEPT
Definition: thread:79
Definition: xthread:21
Definition: xthread:25
_CRTIMP2_PURE void __cdecl _Throw_Cpp_error(int _Code)
Definition: xthread:22
id get_id() const _NOEXCEPT
Definition: thread:199
Definition: xthreads.h:17
_Thrd_t _Thr
Definition: thread:116
thread::id get_id() _NOEXCEPT
Definition: thread:204
#define _Thr_set_null(thr)
Definition: xthrcommon.h:42
bool thread::joinable ( ) const
inline
80  { // return true if this thread can be joined
81  return (!_Thr_is_null(_Thr));
82  }
#define _Thr_is_null(thr)
Definition: xthrcommon.h:43
_Thrd_t _Thr
Definition: thread:116
native_handle_type thread::native_handle ( )
inline
102  { // return Win32 HANDLE as void *
103  return (_Thr._Hnd);
104  }
void * _Hnd
Definition: xthrcommon.h:37
_Thrd_t _Thr
Definition: thread:116
thread& thread::operator= ( thread &&  _Other)
inline
67  { // move from _Other
68  return (_Move_thread(_Other));
69  }
thread & _Move_thread(thread &_Other)
Definition: thread:107
thread& thread::operator= ( const thread )
delete
void thread::swap ( thread _Other)
inline
75  { // swap with _Other
76  _STD swap(_Thr, _Other._Thr);
77  }
void swap(thread &_Other) _NOEXCEPT
Definition: thread:74
_Thrd_t _Thr
Definition: thread:116

Member Data Documentation

_Thrd_t thread::_Thr
private

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