Use a naked pthread_self() call in the HDF5 thread wrappers.

This commit is contained in:
David Young 2020-02-05 19:31:59 -06:00
parent 80179b0648
commit 224cb4a034
2 changed files with 2 additions and 6 deletions

View File

@ -262,7 +262,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex)
if (ret_value)
return ret_value;
if(mutex->lock_count && pthread_equal(HDpthread_self(), mutex->owner_thread)) {
if(mutex->lock_count && pthread_equal(pthread_self(), mutex->owner_thread)) {
/* already owned by self - increment count */
mutex->lock_count++;
} else {
@ -271,7 +271,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex)
pthread_cond_wait(&mutex->cond_var, &mutex->atomic_lock);
/* After we've received the signal, take ownership of the mutex */
mutex->owner_thread = HDpthread_self();
mutex->owner_thread = pthread_self();
mutex->lock_count = 1;
}

View File

@ -1545,10 +1545,6 @@ extern char *strdup(const char *s);
#define HDstrdup(S) strdup(S)
#endif /* HDstrdup */
#ifndef HDpthread_self
#define HDpthread_self() pthread_self()
#endif /* HDpthread_self */
/* Macro for "stringizing" an integer in the C preprocessor (use H5_TOSTRING) */
/* (use H5_TOSTRING, H5_STRINGIZE is just part of the implementation) */
#define H5_STRINGIZE(x) #x