return 0;
}
+typedef void (*once_posix_cb_t)(void);
+
+static BOOL once_wrapper(PINIT_ONCE once, void *arg, void **ctx)
+{
+ once_posix_cb_t cb = arg;
+ arg();
+ return TRUE;
+}
+
+int pthread_once(pthread_once_t *once, void (*once_func)(void))
+{
+ return InitOnceExecuteOnce(once, once_wrapper, once_func, NULL) ? 0 : -1;
+}
+
#endif /* win32 */
#endif /* !HAVE_PTHREAD_H */
#define pthread_mutex_lock(a) compat_pthread_mutex_lock(a)
#define pthread_mutex_unlock(a) compat_pthread_mutex_unlock(a)
#define pthread_join(a,b) compat_pthread_join(a,b)
+#define pthread_once(a,b) compat_pthread_once(a,b)
typedef HANDLE pthread_t;
typedef HANDLE pthread_mutex_t;
int pthread_mutex_unlock(pthread_mutex_t *lock);
int pthread_join(pthread_t *t, void **ret);
+#define PTHREAD_ONCE_INIT INIT_ONCE_STATIC_INIT
+typedef INIT_ONCE pthread_once_t;
+int pthread_once(pthread_once_t *once, void (*once_func)(void));
+
#endif /* WIN32 */
#endif /* HAVE_PTHREAD_H */