diff options
Diffstat (limited to 'src/H5private.h')
-rw-r--r-- | src/H5private.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/H5private.h b/src/H5private.h index 3875fb3..cc36d16 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,15 @@ 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 \ + if (!H5_INIT_GLOBAL) \ + InitOnceExecuteOnce(&H5TS_first_init_g, H5TS_win32_first_thread_init, NULL, NULL); +#else +#define H5_FIRST_THREAD_INIT \ + if (!H5_INIT_GLOBAL) \ + pthread_once(&H5TS_first_init_g, H5TS_first_thread_init); +#endif /* Macros for threadsafe HDF-5 Phase I locks */ #define H5_API_LOCK \ |