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

Public Member Functions

 thread ()
 
template<class _Func >
 thread (_Func _Fp)
 
 ~thread () _NOEXCEPT
 
bool operator== (const thread &_Other) const
 
bool operator!= (const thread &_Other) const
 
void join ()
 

Static Public Member Functions

static void sleep (const xtime &_Xt)
 
static void yield ()
 

Private Member Functions

 thread (const thread &)
 
threadoperator= (const thread &)
 

Private Attributes

thrd_t _Thr
 
bool _Joinable
 

Friends

class thread_group
 

Constructor & Destructor Documentation

stdext::threads::thread::thread ( )
inline
25  : _Joinable(false)
26  { // construct
27  _Thr = thrd_current();
28  }
#define thrd_current
Definition: threads.h:34
thrd_t _Thr
Definition: thread:72
bool _Joinable
Definition: thread:73
template<class _Func >
stdext::threads::thread::thread ( _Func  _Fp)
inline
32  : _Joinable(true)
33  { // construct with _Fp()
34  _STD _Launch(&_Thr, _STD bind(_Fp));
35  }
thrd_t _Thr
Definition: thread:72
void _Launch(_Thrd_t *_Thr, _Target &&_Tg)
Definition: xthread:203
bool _Joinable
Definition: thread:73
stdext::threads::thread::~thread ( )
inline
38  { // destroy
39  if (_Joinable)
41  }
thrd_t _Thr
Definition: thread:72
#define thrd_detach(thr)
Definition: threads.h:28
bool _Joinable
Definition: thread:73
stdext::threads::thread::thread ( const thread )
private

Member Function Documentation

void stdext::threads::thread::join ( )
inline
54  { // join thread
56  "threads::thread::join called on non-joinable thread");
57  _Joinable = false;
58  thrd_join(_Thr, 0);
59  }
thrd_t _Thr
Definition: thread:72
#define _THREAD_ASSERT(expr, msg)
Definition: xthrcommon.h:66
bool _Joinable
Definition: thread:73
#define thrd_join(thr, res)
Definition: threads.h:30
bool stdext::threads::thread::operator!= ( const thread _Other) const
inline
49  { // test for inequality
50  return (!(*this == _Other));
51  }
thread& stdext::threads::thread::operator= ( const thread )
private
bool stdext::threads::thread::operator== ( const thread _Other) const
inline
44  { // test for equality
45  return (thrd_equal(_Thr, _Other._Thr) != 0);
46  }
#define thrd_equal(thr0, thr1)
Definition: threads.h:33
thrd_t _Thr
Definition: thread:72
_Thrd_t _Thr
Definition: thread:115
static void stdext::threads::thread::sleep ( const xtime _Xt)
inlinestatic
62  { // sleep for a time
63  thrd_sleep(&_Xt);
64  }
#define thrd_sleep(tm)
Definition: threads.h:31
static void stdext::threads::thread::yield ( )
inlinestatic
67  { // yield control
68  thrd_yield();
69  }
#define thrd_yield
Definition: threads.h:32

Friends And Related Function Documentation

friend class thread_group
friend

Member Data Documentation

bool stdext::threads::thread::_Joinable
private
thrd_t stdext::threads::thread::_Thr
private

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