]> pd.if.org Git - pdclib/blob - platform/win32/internals/_PDCLIB_threadconfig.h
win32: Fix warnings relating to definition of LONG and use of InterlockedCompareExchange
[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          long   _ThreadId; \r
24     volatile unsigned  int   _NestCount;\r
25 };\r
26 \r
27 #define _PDCLIB_TSS_T struct _PDCLIB_tss *\r
28 \r
29 struct _PDCLIB_tss {\r
30     void    (*_Destructor)(void*);\r
31     struct _PDCLIB_tss * _Next;\r
32     unsigned int _Key;\r
33 };\r
34 \r
35 _PDCLIB_END_EXTERN_C\r
36 #endif\r