STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Macros | Enumerations | Functions
xthread File Reference
#include <thr/xthrcommon.h>
#include <thr/xtime>
#include <thr/xthreads.h>
#include <type_traits>

Classes

class  _Auto_cnd
 
class  _Auto_mtx
 
class  _Pad
 
class  _LaunchPad< _Target >
 

Macros

#define _THR_XTHREAD_
 

Enumerations

enum  {
  _DEVICE_OR_RESOURCE_BUSY, _INVALID_ARGUMENT, _NO_SUCH_PROCESS, _NOT_ENOUGH_MEMORY,
  _OPERATION_NOT_PERMITTED, _RESOURCE_DEADLOCK_WOULD_OCCUR, _RESOURCE_UNAVAILABLE_TRY_AGAIN
}
 

Functions

_CRTIMP2_PURE void __cdecl _Throw_C_error (int code)
 
_CRTIMP2_PURE void __cdecl _Throw_Cpp_error (int code)
 
int _Check_C_return (int _Res)
 
int _Check_C_return (int _Res, int _Other)
 
int _Thrd_startX (_Thrd_imp_t *_Thr, _Thrd_callback_t _Fp, void *_Arg)
 
int _Thrd_detachX (_Thrd_t _Thr)
 
int _Thrd_joinX (_Thrd_t _Thr, int *_Res)
 
int _Mtx_initX (_Mtx_t *_Mtx, int _Type)
 
int _Mtx_lockX (_Mtx_t *_Mtx)
 
int _Mtx_trylockX (_Mtx_t *_Mtx)
 
int _Mtx_timedlockX (_Mtx_t *_Mtx, const xtime *_Xt)
 
int _Mtx_unlockX (_Mtx_t *_Mtx)
 
int _Cnd_initX (_Cnd_t *_Cnd)
 
int _Cnd_waitX (_Cnd_t *_Cnd, _Mtx_t *_Mtx)
 
int _Cnd_timedwaitX (_Cnd_t *_Cnd, _Mtx_t *_Mtx, const xtime *_Xt)
 
int _Cnd_broadcastX (_Cnd_t *_Cnd)
 
int _Cnd_signalX (_Cnd_t *_Cnd)
 
template<class _Target >
void _Launch (_Thrd_t *_Thr, _Target &&_Tg)
 

Macro Definition Documentation

#define _THR_XTHREAD_

Enumeration Type Documentation

anonymous enum
Enumerator
_DEVICE_OR_RESOURCE_BUSY 
_INVALID_ARGUMENT 
_NO_SUCH_PROCESS 
_NOT_ENOUGH_MEMORY 
_OPERATION_NOT_PERMITTED 
_RESOURCE_DEADLOCK_WOULD_OCCUR 
_RESOURCE_UNAVAILABLE_TRY_AGAIN 
17  { // constants for error codes
25  };
Definition: xthread:19
Definition: xthread:18
Definition: xthread:21
Definition: xthread:20
Definition: xthread:24
Definition: xthread:23
Definition: xthread:22

Function Documentation

int _Check_C_return ( int  _Res)
inline
31  { // throw exception on failure
32  if (_Res != _Thrd_success)
33  _Throw_C_error(_Res);
34  return (_Res);
35  }
_CRTIMP2_PURE void __cdecl _Throw_C_error(int code)
Definition: xthreads.h:17
int _Check_C_return ( int  _Res,
int  _Other 
)
inline
38  { // throw exception on failure
39  if (_Res != _Thrd_success && _Res != _Other)
40  _Throw_C_error(_Res);
41  return (_Res);
42  }
_CRTIMP2_PURE void __cdecl _Throw_C_error(int code)
Definition: xthreads.h:17
int _Cnd_broadcastX ( _Cnd_t _Cnd)
inline
102  { // throw exception on failure
103  return (_Check_C_return(_Cnd_broadcast(_Cnd)));
104  }
int _Check_C_return(int _Res)
Definition: xthread:30
_CRTIMP2_PURE int __cdecl _Cnd_broadcast(_Cnd_t *)
int _Cnd_initX ( _Cnd_t _Cnd)
inline
87  { // throw exception on failure
88  return (_Check_C_return(_Cnd_init(_Cnd)));
89  }
int _Check_C_return(int _Res)
Definition: xthread:30
_CRTIMP2_PURE int __cdecl _Cnd_init(_Cnd_t *)
int _Cnd_signalX ( _Cnd_t _Cnd)
inline
107  { // throw exception on failure
108  return (_Check_C_return(_Cnd_signal(_Cnd)));
109  }
int _Check_C_return(int _Res)
Definition: xthread:30
_CRTIMP2_PURE int __cdecl _Cnd_signal(_Cnd_t *)
int _Cnd_timedwaitX ( _Cnd_t _Cnd,
_Mtx_t _Mtx,
const xtime _Xt 
)
inline
97  { // throw exception on failure
98  return (_Check_C_return(_Cnd_timedwait(_Cnd, _Mtx, _Xt), _Thrd_timedout));
99  }
int _Check_C_return(int _Res)
Definition: xthread:30
_CRTIMP2_PURE int __cdecl _Cnd_timedwait(_Cnd_t *, _Mtx_t *, const xtime *)
Definition: xthreads.h:19
int _Cnd_waitX ( _Cnd_t _Cnd,
_Mtx_t _Mtx 
)
inline
92  { // throw exception on failure
93  return (_Check_C_return(_Cnd_wait(_Cnd, _Mtx)));
94  }
_CRTIMP2_PURE int __cdecl _Cnd_wait(_Cnd_t *, _Mtx_t *)
int _Check_C_return(int _Res)
Definition: xthread:30
template<class _Target >
void _Launch ( _Thrd_t _Thr,
_Target &&  _Tg 
)
inline
204  { // launch a new thread
205  _LaunchPad<_Target> _Launcher(_STD forward<_Target>(_Tg));
206  _Launcher._Launch(_Thr);
207  }
Definition: xthread:175
int _Mtx_initX ( _Mtx_t _Mtx,
int  _Type 
)
inline
62  { // throw exception on failure
63  return (_Check_C_return(_Mtx_init(_Mtx, _Type)));
64  }
int _Check_C_return(int _Res)
Definition: xthread:30
_CRTIMP2_PURE int __cdecl _Mtx_init(_Mtx_t *, int)
_In_ wctype_t _Type
Definition: ctype.h:205
int _Mtx_lockX ( _Mtx_t _Mtx)
inline
67  { // throw exception on failure
68  return (_Check_C_return(_Mtx_lock(_Mtx)));
69  }
int _Check_C_return(int _Res)
Definition: xthread:30
_CRTIMP2_PURE int __cdecl _Mtx_lock(_Mtx_t *)
int _Mtx_timedlockX ( _Mtx_t _Mtx,
const xtime _Xt 
)
inline
77  { // throw exception on failure
78  return (_Check_C_return(_Mtx_timedlock(_Mtx, _Xt), _Thrd_timedout));
79  }
_CRTIMP2_PURE int __cdecl _Mtx_timedlock(_Mtx_t *, const xtime *)
int _Check_C_return(int _Res)
Definition: xthread:30
Definition: xthreads.h:19
int _Mtx_trylockX ( _Mtx_t _Mtx)
inline
72  { // throw exception on failure
73  return (_Check_C_return(_Mtx_trylock(_Mtx), _Thrd_busy));
74  }
_CRTIMP2_PURE int __cdecl _Mtx_trylock(_Mtx_t *)
int _Check_C_return(int _Res)
Definition: xthread:30
Definition: xthreads.h:20
int _Mtx_unlockX ( _Mtx_t _Mtx)
inline
82  { // throw exception on failure
83  return (_Check_C_return(_Mtx_unlock(_Mtx)));
84  }
int _Check_C_return(int _Res)
Definition: xthread:30
_CRTIMP2_PURE int __cdecl _Mtx_unlock(_Mtx_t *)
int _Thrd_detachX ( _Thrd_t  _Thr)
inline
52  { // throw exception on failure
53  return (_Check_C_return(_Thrd_detach(_Thr)));
54  }
int _Check_C_return(int _Res)
Definition: xthread:30
_CRTIMP2_PURE int __cdecl _Thrd_detach(_Thrd_t)
int _Thrd_joinX ( _Thrd_t  _Thr,
int _Res 
)
inline
57  { // throw exception on failure
58  return (_Check_C_return(_Thrd_join(_Thr, _Res)));
59  }
_CRTIMP2_PURE int __cdecl _Thrd_join(_Thrd_t, int *)
int _Check_C_return(int _Res)
Definition: xthread:30
int _Thrd_startX ( _Thrd_imp_t _Thr,
_Thrd_callback_t  _Fp,
void _Arg 
)
inline
46  { // throw exception on failure
47  int _Res = _Thrd_start(_Thr, _Fp, _Arg);
48  return (_Check_C_return(_Res != _Thrd_error ? _Res : _Thrd_nomem));
49  }
Definition: xthreads.h:21
int _Check_C_return(int _Res)
Definition: xthread:30
Definition: xthreads.h:18
_CRTIMP2_PURE int __cdecl _Thrd_start(_Thrd_imp_t *, _Thrd_callback_t, void *)
_CRTIMP2_PURE void __cdecl _Throw_C_error ( int  code)
_CRTIMP2_PURE void __cdecl _Throw_Cpp_error ( int  code)