]> pd.if.org Git - pdclib/blob - platform/win32/internals/_PDCLIB_threadconfig.h
dos2unix
[pdclib] / platform / win32 / internals / _PDCLIB_threadconfig.h
1 #ifndef _PDCLIB_THREADCONFIG_H
2 #define _PDCLIB_THREADCONFIG_H
3 #include "_PDCLIB_aux.h"
4 #include "_PDCLIB_int.h"
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 #define _PDCLIB_TSS_DTOR_ITERATIONS 3
10 #define _PDCLIB_ONCE_FLAG_INIT { -1, 0 }
11 #define _PDCLIB_ONCE_FLAG_IS_DONE( _f ) ((_f)->_State == 0)
12 typedef struct {
13     long  _State;
14     void *_Handle;
15 } _PDCLIB_once_flag;
16
17 void _PDCLIB_call_once(_PDCLIB_once_flag *flag, void (*func)(void));
18
19 //#define _PDCLIB_THRD_HAVE_MISC
20 //#define _PDCLIB_CND_T char
21 #define _PDCLIB_MTX_T struct _PDCLIB_mtx 
22
23 struct _PDCLIB_mtx {
24     void                   * _WaitEvHandle;
25     volatile          long   _ThreadId; 
26     volatile unsigned  int   _NestCount;
27 };
28
29 #define _PDCLIB_TSS_T struct _PDCLIB_tss *
30
31 struct _PDCLIB_tss {
32     void    (*_Destructor)(void*);
33     struct _PDCLIB_tss * _Next;
34     unsigned int _Key;
35 };
36
37 #ifdef __cplusplus
38 }
39 #endif
40 #endif