]> pd.if.org Git - pdclib/blobdiff - opt/nothread/call_once.c
* Change the style of inclusion of the internal/ headers. Modern preprocessors
[pdclib] / opt / nothread / call_once.c
diff --git a/opt/nothread/call_once.c b/opt/nothread/call_once.c
new file mode 100644 (file)
index 0000000..06de779
--- /dev/null
@@ -0,0 +1,9 @@
+#include <threads.h>\r
+\r
+void _PDCLIB_call_once(_PDCLIB_once_flag *flag, void (*func)(void))\r
+{\r
+       if(*flag != _PDCLIB_ONCE_FLAG_DONE) {\r
+               func();\r
+               *flag = _PDCLIB_ONCE_FLAG_DONE;\r
+       }\r
+}
\ No newline at end of file