summaryrefslogtreecommitdiffstats
path: root/test/h5test.c
diff options
context:
space:
mode:
authorScott Wegner <swegner@hdfgroup.org>2008-06-06 19:10:20 (GMT)
committerScott Wegner <swegner@hdfgroup.org>2008-06-06 19:10:20 (GMT)
commit720a985115244e2e075aa632847fdf2e46bc48bd (patch)
tree8b380a566e459f962331f1e2d7a89b9315f73e2a /test/h5test.c
parent0b5f34bfa659d0cde87a1f120843f8003ee2a81b (diff)
downloadhdf5-720a985115244e2e075aa632847fdf2e46bc48bd.zip
hdf5-720a985115244e2e075aa632847fdf2e46bc48bd.tar.gz
hdf5-720a985115244e2e075aa632847fdf2e46bc48bd.tar.bz2
[svn-r15163] 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 'test/h5test.c')
-rw-r--r--test/h5test.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/test/h5test.c b/test/h5test.c
index e364d32..98508ff 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -667,14 +667,7 @@ h5_show_hostname(void)
printf("thread 0.");
}
#elif defined(H5_HAVE_THREADSAFE)
-#ifdef _WIN32
- /* use GetCurrentThreadId because pthread_self return cannot be cast */
- /* as an int on Windows */
- fprintf("thread %d.", (int)GetCurrentThreadId());
-#else
- printf("thread %d.", (int)pthread_self());
-#endif
-
+ printf("thread %lu.", HDpthread_self_ulong());
#else
printf("thread 0.");
#endif