summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 3875fb3..d506a59 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -30,8 +30,12 @@
/* include the pthread header */
#ifdef H5_HAVE_THREADSAFE
+#ifdef H5_HAVE_PTHREAD_H
#include <pthread.h>
-#endif
+#else /* H5_HAVE_PTHREAD_H */
+#define H5_HAVE_WIN_THREADS
+#endif /* H5_HAVE_PTHREAD_H */
+#endif /* H5_HAVE_THREADSAFE */
/*
* Include ANSI-C header files.
@@ -1666,8 +1670,11 @@ typedef struct H5_api_struct {
#define H5_INIT_GLOBAL H5_g.H5_libinit_g
/* Macro for first thread initialization */
-#define H5_FIRST_THREAD_INIT \
- pthread_once(&H5TS_first_init_g, H5TS_first_thread_init);
+#ifdef H5_HAVE_WIN_THREADS
+#define H5_FIRST_THREAD_INIT InitOnceExecuteOnce(&H5TS_first_init_g, H5TS_win32_first_thread_init, NULL, NULL);
+#else
+#define H5_FIRST_THREAD_INIT pthread_once(&H5TS_first_init_g, H5TS_pthread_first_thread_init);
+#endif
/* Macros for threadsafe HDF-5 Phase I locks */
#define H5_API_LOCK \