]> pd.if.org Git - pdclib/blob - platform/win32/internals/_PDCLIB_threadconfig.h
Sweeping cleanups. Sorry for the massive commit; I got sidetracked once too often.
[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 #ifdef __cplusplus
7 extern "C" {
8 #endif\r
9 #define _PDCLIB_TSS_DTOR_ITERATIONS 3\r
10 #define _PDCLIB_ONCE_FLAG_INIT { -1, 0 }\r
11 #define _PDCLIB_ONCE_FLAG_IS_DONE( _f ) ((_f)->_State == 0)\r
12 typedef struct {\r
13     long  _State;\r
14     void *_Handle;\r
15 } _PDCLIB_once_flag;\r
16 \r
17 void _PDCLIB_call_once(_PDCLIB_once_flag *flag, void (*func)(void));\r
18 \r
19 //#define _PDCLIB_THRD_HAVE_MISC\r
20 //#define _PDCLIB_CND_T char\r
21 #define _PDCLIB_MTX_T struct _PDCLIB_mtx \r
22 \r
23 struct _PDCLIB_mtx {\r
24     void                   * _WaitEvHandle;\r
25     volatile          long   _ThreadId; \r
26     volatile unsigned  int   _NestCount;\r
27 };\r
28 \r
29 #define _PDCLIB_TSS_T struct _PDCLIB_tss *\r
30 \r
31 struct _PDCLIB_tss {\r
32     void    (*_Destructor)(void*);\r
33     struct _PDCLIB_tss * _Next;\r
34     unsigned int _Key;\r
35 };\r
36 \r
37 #ifdef __cplusplus
38 }
39 #endif\r
40 #endif\r