summaryrefslogtreecommitdiffstats
path: root/src/H5TS.c
diff options
context:
space:
mode:
authorScott Wegner <swegner@hdfgroup.org>2008-06-06 19:11:46 (GMT)
committerScott Wegner <swegner@hdfgroup.org>2008-06-06 19:11:46 (GMT)
commit259d1afce9bca2f7dfada3bd396e7f804bb3c1a6 (patch)
treeb2c754200c341f52256a3b3c45924bf38d3c3769 /src/H5TS.c
parentba9abd20069ec92af1b25ff1a5ea9b88d84462b8 (diff)
downloadhdf5-259d1afce9bca2f7dfada3bd396e7f804bb3c1a6.zip
hdf5-259d1afce9bca2f7dfada3bd396e7f804bb3c1a6.tar.gz
hdf5-259d1afce9bca2f7dfada3bd396e7f804bb3c1a6.tar.bz2
[svn-r15165] Purpose: Create new HDpthread_self and HDpthread_self_ulong macros
Description: On Windows, the pthread_self function cannot be used to print the returned thread ID for debugging. Instead, we need a separate function, GetCurrentThreadId. To eliminate some Windows ifdef's in the code, we create two new function macros which can be used by all platforms. It is conditionally defined in H5win32defs.h, and globally in H5private.h. Tested: VS2005 w/ pthreads on WinXP kagiso w/ pthreads
Diffstat (limited to 'src/H5TS.c')
-rw-r--r--src/H5TS.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/H5TS.c b/src/H5TS.c
index a250067..5d38487 100644
--- a/src/H5TS.c
+++ b/src/H5TS.c
@@ -146,7 +146,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex)
if (ret_value)
return ret_value;
- if(mutex->lock_count && pthread_equal(pthread_self(), mutex->owner_thread)) {
+ if(mutex->lock_count && pthread_equal(HDpthread_self(), mutex->owner_thread)) {
/* already owned by self - increment count */
mutex->lock_count++;
} else {
@@ -155,7 +155,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 = pthread_self();
+ mutex->owner_thread = HDpthread_self();
mutex->lock_count = 1;
}