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 <tuple>
#include <type_traits>
#include <utility>

Classes

class  _Auto_cnd
 
class  _Auto_mtx
 
class  _Pad
 
class  _LaunchPad< _Target >
 

Macros

#define _THR_XTHREAD_
 
#define _CALL_FUNC_MODIFIER   _STDCALL
 

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 _CALL_FUNC_MODIFIER   _STDCALL
#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 
19  { // constants for error codes
27  };
Definition: xthread:26
Definition: xthread:23
Definition: xthread:21
Definition: xthread:25
Definition: xthread:24
Definition: xthread:20
Definition: xthread:22

Function Documentation

int _Check_C_return ( int  _Res)
inline
33  { // throw exception on failure
34  if (_Res != _Thrd_success)
35  _Throw_C_error(_Res);
36  return (_Res);
37  }
_CRTIMP2_PURE void __cdecl _Throw_C_error(int _Code)
Definition: xthreads.h:17
int _Check_C_return ( int  _Res,
int  _Other 
)
inline
40  { // throw exception on failure
41  if (_Res != _Thrd_success && _Res != _Other)
42  _Throw_C_error(_Res);
43  return (_Res);
44  }
_CRTIMP2_PURE void __cdecl _Throw_C_error(int _Code)
Definition: xthreads.h:17
int _Cnd_broadcastX ( _Cnd_t  _Cnd)
inline
105  { // throw exception on failure
106  return (_Check_C_return(_Cnd_broadcast(_Cnd)));
107  }
int _Check_C_return(int _Res)
Definition: xthread:32
_CRTIMP2_PURE int __cdecl _Cnd_broadcast(_Cnd_t)
int _Cnd_initX ( _Cnd_t _Cnd)
inline
89  { // throw exception on failure
90  return (_Check_C_return(_Cnd_init(_Cnd)));
91  }
int _Check_C_return(int _Res)
Definition: xthread:32
_CRTIMP2_PURE int __cdecl _Cnd_init(_Cnd_t *)
int _Cnd_signalX ( _Cnd_t  _Cnd)
inline
110  { // throw exception on failure
111  return (_Check_C_return(_Cnd_signal(_Cnd)));
112  }
int _Check_C_return(int _Res)
Definition: xthread:32
_CRTIMP2_PURE int __cdecl _Cnd_signal(_Cnd_t)
int _Cnd_timedwaitX ( _Cnd_t  _Cnd,
_Mtx_t  _Mtx,
const xtime _Xt 
)
inline
100  { // throw exception on failure
101  return (_Check_C_return(_Cnd_timedwait(_Cnd, _Mtx, _Xt), _Thrd_timedout));
102  }
Definition: xthreads.h:19
_CRTIMP2_PURE int __cdecl _Cnd_timedwait(_Cnd_t, _Mtx_t, const xtime *)
int _Check_C_return(int _Res)
Definition: xthread:32
int _Cnd_waitX ( _Cnd_t  _Cnd,
_Mtx_t  _Mtx 
)
inline
94  { // throw exception on failure
95  return (_Check_C_return(_Cnd_wait(_Cnd, _Mtx)));
96  }
int _Check_C_return(int _Res)
Definition: xthread:32
_CRTIMP2_PURE int __cdecl _Cnd_wait(_Cnd_t, _Mtx_t)
template<class _Target >
void _Launch ( _Thrd_t _Thr,
_Target &&  _Tg 
)
inline
258  { // launch a new thread
259  _LaunchPad<_Target> _Launcher(_STD forward<_Target>(_Tg));
260  _Launcher._Launch(_Thr);
261  }
Definition: xthread:220
int _Mtx_initX ( _Mtx_t _Mtx,
int  _Type 
)
inline
64  { // throw exception on failure
65  return (_Check_C_return(_Mtx_init(_Mtx, _Type)));
66  }
int _Check_C_return(int _Res)
Definition: xthread:32
_CRTIMP2_PURE int __cdecl _Mtx_init(_Mtx_t *, int)
int _Mtx_lockX ( _Mtx_t  _Mtx)
inline
69  { // throw exception on failure
70  return (_Check_C_return(_Mtx_lock(_Mtx)));
71  }
_CRTIMP2_PURE int __cdecl _Mtx_lock(_Mtx_t)
int _Check_C_return(int _Res)
Definition: xthread:32
int _Mtx_timedlockX ( _Mtx_t  _Mtx,
const xtime _Xt 
)
inline
79  { // throw exception on failure
80  return (_Check_C_return(_Mtx_timedlock(_Mtx, _Xt), _Thrd_timedout));
81  }
Definition: xthreads.h:19
int _Check_C_return(int _Res)
Definition: xthread:32
_CRTIMP2_PURE int __cdecl _Mtx_timedlock(_Mtx_t, const xtime *)
int _Mtx_trylockX ( _Mtx_t  _Mtx)
inline
74  { // throw exception on failure
75  return (_Check_C_return(_Mtx_trylock(_Mtx), _Thrd_busy));
76  }
Definition: xthreads.h:20
int _Check_C_return(int _Res)
Definition: xthread:32
_CRTIMP2_PURE int __cdecl _Mtx_trylock(_Mtx_t)
int _Mtx_unlockX ( _Mtx_t  _Mtx)
inline
84  { // throw exception on failure
85  return (_Check_C_return(_Mtx_unlock(_Mtx)));
86  }
int _Check_C_return(int _Res)
Definition: xthread:32
_CRTIMP2_PURE int __cdecl _Mtx_unlock(_Mtx_t)
int _Thrd_detachX ( _Thrd_t  _Thr)
inline
54  { // throw exception on failure
55  return (_Check_C_return(_Thrd_detach(_Thr)));
56  }
int _Check_C_return(int _Res)
Definition: xthread:32
_CRTIMP2_PURE int __cdecl _Thrd_detach(_Thrd_t)
int _Thrd_joinX ( _Thrd_t  _Thr,
int *  _Res 
)
inline
59  { // throw exception on failure
60  return (_Check_C_return(_Thrd_join(_Thr, _Res)));
61  }
_CRTIMP2_PURE int __cdecl _Thrd_join(_Thrd_t, int *)
int _Check_C_return(int _Res)
Definition: xthread:32
int _Thrd_startX ( _Thrd_imp_t _Thr,
_Thrd_callback_t  _Fp,
void _Arg 
)
inline
48  { // throw exception on failure
49  int _Res = _Thrd_start(_Thr, _Fp, _Arg);
50  return (_Check_C_return(_Res != _Thrd_error ? _Res : _Thrd_nomem));
51  }
Definition: xthreads.h:18
int _Check_C_return(int _Res)
Definition: xthread:32
Definition: xthreads.h:21
_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)