From a1091585ad897ee93ffcb0ba435fa4930a1e8572 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Thu, 14 Jan 2021 11:44:28 -0800 Subject: Fixes naked pthread usage in H5TS code added for async (#260) --- src/H5TS.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/H5TS.c b/src/H5TS.c index 09caf51..732f41c 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -472,9 +472,9 @@ herr_t H5TS_mutex_lock(H5TS_mutex_t *mutex) /* Release the library lock */ ret_value = HDpthread_mutex_unlock(&mutex->atomic_lock); -#endif /* H5_HAVE_WIN_THREADS */ done: +#endif /* H5_HAVE_WIN_THREADS */ FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* end H5TS_mutex_lock() */ @@ -527,9 +527,9 @@ H5TS__mutex_unlock(H5TS_mutex_t *mutex, unsigned int *lock_count) if (err != 0) ret_value = err; } /* end if */ -#endif /* H5_HAVE_WIN_THREADS */ done: +#endif /* H5_HAVE_WIN_THREADS */ FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS__mutex_unlock */ @@ -582,9 +582,9 @@ H5TS_mutex_unlock(H5TS_mutex_t *mutex) if (err != 0) ret_value = err; } /* end if */ -#endif /* H5_HAVE_WIN_THREADS */ done: +#endif /* H5_HAVE_WIN_THREADS */ FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS_mutex_unlock */ @@ -608,6 +608,9 @@ H5TSmutex_get_attempt_count(unsigned int *count) FUNC_ENTER_API_NAMECHECK_ONLY /*NO TRACE*/ +#ifdef H5_HAVE_WIN_THREADS + /* Add Win32 equivalent here when async is supported */ +#else /* H5_HAVE_WIN_THREADS */ ret_value = HDpthread_mutex_lock(&H5_g.init_lock.atomic_lock2); if (ret_value) HGOTO_DONE(ret_value); @@ -619,6 +622,7 @@ H5TSmutex_get_attempt_count(unsigned int *count) HGOTO_DONE(ret_value); done: +#endif /* H5_HAVE_WIN_THREADS */ FUNC_LEAVE_API_NAMECHECK_ONLY(ret_value) } /* end H5TSmutex_get_attempt_count() */ @@ -719,9 +723,9 @@ H5TS_cancel_count_inc(void) * previous cancellation state until the final API routine is returning. */ ++cancel_counter->cancel_count; -#endif /* H5_HAVE_WIN_THREADS */ done: +#endif /* H5_HAVE_WIN_THREADS */ FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* end H5TS_cancel_count_inc() */ -- cgit v0.12