summaryrefslogtreecommitdiff
path: root/include/my_no_pthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/my_no_pthread.h')
-rw-r--r--include/my_no_pthread.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/my_no_pthread.h b/include/my_no_pthread.h
index b11dbff42f0..511fac407d5 100644
--- a/include/my_no_pthread.h
+++ b/include/my_no_pthread.h
@@ -47,4 +47,12 @@
#define rw_unlock(A)
#define rwlock_destroy(A)
+typedef int my_pthread_once_t;
+#define MY_PTHREAD_ONCE_INIT 0
+#define MY_PTHREAD_ONCE_DONE 1
+
+#define my_pthread_once(C,F) do { \
+ if (*(C) != MY_PTHREAD_ONCE_DONE) { F(); *(C)= MY_PTHREAD_ONCE_DONE; } \
+ } while(0)
+
#endif