]> pd.if.org Git - pdclib.old/blobdiff - includes/threads.h
Modify various POSIX platform files so you can build on top of glibc for testing
[pdclib.old] / includes / threads.h
index 4549883cd5e2463022e21734ef94e5029f6e566a..77e39d494f77a579830cd2151ab68a55bf9a31eb 100644 (file)
@@ -1,5 +1,6 @@
 #ifndef _PDCLIB_THREADS_H\r
 #define _PDCLIB_THREADS_H\r
+#include <_PDCLIB_int.h>\r
 #include <_PDCLIB_threadconfig.h>\r
 #include <time.h>\r
 _PDCLIB_BEGIN_EXTERN_C\r
@@ -28,12 +29,12 @@ enum {
 #if defined(_PDCLIB_ONCE_FLAG_IS_DONE)\r
 static inline void call_once(once_flag *flag, void (*func)(void))\r
 {\r
-       if(_PDCLIB_ONCE_FLAG_IS_DONE(flag)) {\r
+       if(!_PDCLIB_ONCE_FLAG_IS_DONE(flag)) {\r
                _PDCLIB_call_once(flag, func);\r
        }\r
 }\r
 #else\r
-void call_once(once_flag *flag, void (*func)(void))\r
+void call_once(once_flag *flag, void (*func)(void));\r
 #endif\r
 \r
 #if defined(_PDCLIB_MTX_T)\r
@@ -61,7 +62,7 @@ int cnd_wait(cnd_t *cond, mtx_t *mtx) _PDCLIB_nothrow;
 #if defined(_PDCLIB_THRD_T)\r
 #define _PDCLIB_THRD_HAVE_MISC\r
 typedef _PDCLIB_THRD_T         thrd_t;\r
-typedef int (*)(void*)  thrd_start_t;\r
+typedef int (*thrd_start_t)(void*);\r
 \r
 int thrd_create(thrd_t *thr, thrd_start_t func, void *arg) _PDCLIB_nothrow;\r
 thrd_t thrd_current(void) _PDCLIB_nothrow;\r