]> pd.if.org Git - pdclib.old/commitdiff
_PDCLIB_ONCE_FLAG_DONE -> _PDCLIB_ONCE_FLAG_IS_DONE(flag) to support once_flag types...
authorOwen Shepherd <owen.shepherd@e43.eu>
Wed, 22 Aug 2012 21:05:16 +0000 (22:05 +0100)
committerOwen Shepherd <owen.shepherd@e43.eu>
Wed, 22 Aug 2012 21:05:16 +0000 (22:05 +0100)
includes/threads.h
opt/nothread/_PDCLIB_threadconfig.h

index c9e3b07f24b656a1730f22f7349f3feb656791eb..4549883cd5e2463022e21734ef94e5029f6e566a 100644 (file)
@@ -25,10 +25,10 @@ enum {
 };\r
 \r
 #define ONCE_FLAG_INIT _PDCLIB_ONCE_FLAG_INIT\r
-#if defined(_PDCLIB_ONCE_FLAG_DONE)\r
+#if defined(_PDCLIB_ONCE_FLAG_IS_DONE)\r
 static inline void call_once(once_flag *flag, void (*func)(void))\r
 {\r
-       if(*flag != _PDCLIB_ONCE_FLAG_DONE) {\r
+       if(_PDCLIB_ONCE_FLAG_IS_DONE(flag)) {\r
                _PDCLIB_call_once(flag, func);\r
        }\r
 }\r
index 39478e97d4c35d28bf57c3c6e0cbf5528fef4dd1..ceeaac4af2e4db3db8f00f05abd5ae31ef70373a 100644 (file)
@@ -5,7 +5,7 @@
 \r
 _PDCLIB_BEGIN_EXTERN_C\r
 #define _PDCLIB_ONCE_FLAG_INIT 0\r
-#define _PDCLIB_ONCE_FLAG_DONE 1\r
+#define _PDCLIB_ONCE_FLAG_IS_DONE(_f) ((_f) == 1)\r
 typedef char _PDCLIB_once_flag;\r
 \r
 void _PDCLIB_call_once(_PDCLIB_once_flag *flag, void (*func)(void));\r