]> pd.if.org Git - pdclib.old/commitdiff
opt nothread: Fix call_once to match recent changes to the implementation method
authorOwen Shepherd <owen.shepherd@e43.eu>
Sat, 25 Aug 2012 20:23:17 +0000 (21:23 +0100)
committerOwen Shepherd <owen.shepherd@e43.eu>
Sat, 25 Aug 2012 20:23:17 +0000 (21:23 +0100)
opt/nothread/_PDCLIB_threadconfig.h
opt/nothread/call_once.c

index ceeaac4af2e4db3db8f00f05abd5ae31ef70373a..3380b5226c989f4b36e8ea0467605a16904a0bc1 100644 (file)
@@ -5,7 +5,7 @@
 \r
 _PDCLIB_BEGIN_EXTERN_C\r
 #define _PDCLIB_ONCE_FLAG_INIT 0\r
-#define _PDCLIB_ONCE_FLAG_IS_DONE(_f) ((_f) == 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
index 83201708b401fecc38e8a3bb0ffad8df89a99014..cce9a499493ad3c4eb80e70b34a37b34299842e9 100644 (file)
@@ -3,9 +3,9 @@
 \r
 void _PDCLIB_call_once(_PDCLIB_once_flag *flag, void (*func)(void))\r
 {\r
-       if(*flag != _PDCLIB_ONCE_FLAG_DONE) {\r
+       if(!_PDCLIB_ONCE_FLAG_IS_DONE(flag)) {\r
                func();\r
-               *flag = _PDCLIB_ONCE_FLAG_DONE;\r
+               *flag = 1;\r
        }\r
 }\r
 #endif\r