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