]> pd.if.org Git - pdclib/blobdiff - platform/win32/internals/_PDCLIB_threadconfig.h
win32: initial pass at thread support
[pdclib] / platform / win32 / internals / _PDCLIB_threadconfig.h
diff --git a/platform/win32/internals/_PDCLIB_threadconfig.h b/platform/win32/internals/_PDCLIB_threadconfig.h
new file mode 100644 (file)
index 0000000..d914ae0
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef _PDCLIB_THREADCONFIG_H\r
+#define _PDCLIB_THREADCONFIG_H\r
+#include <_PDCLIB_aux.h>\r
+#include <_PDCLIB_int.h>\r
+\r
+_PDCLIB_BEGIN_EXTERN_C\r
+#define _PDCLIB_TSS_DTOR_ITERATIONS 3\r
+#define _PDCLIB_ONCE_FLAG_INIT { -1, 0 }\r
+#define _PDCLIB_ONCE_FLAG_IS_DONE( _f ) ((_f)->_State == 0)\r
+typedef struct {\r
+    long  _State;\r
+    void *_Handle;\r
+} _PDCLIB_once_flag;\r
+\r
+void _PDCLIB_call_once(_PDCLIB_once_flag *flag, void (*func)(void));\r
+\r
+//#define _PDCLIB_THRD_HAVE_MISC\r
+//#define _PDCLIB_CND_T char\r
+#define _PDCLIB_MTX_T struct _PDCLIB_mtx \r
+\r
+struct _PDCLIB_mtx {\r
+    void         * _WaitEvHandle;\r
+    volatile   signed long  _State;\r
+    volatile unsigned  int  _ThreadId;\r
+    volatile unsigned  int  _NestCount;\r
+};\r
+\r
+#define _PDCLIB_TSS_T struct _PDCLIB_tss *\r
+\r
+struct _PDCLIB_tss {\r
+    void    (*_Destructor)(void*);\r
+    struct _PDCLIB_tss * _Next;\r
+    unsigned int _Key;\r
+};\r
+\r
+_PDCLIB_END_EXTERN_C\r
+#endif\r