summaryrefslogtreecommitdiffstats
path: root/test/ttsafe_acreate.c
diff options
context:
space:
mode:
authorMike McGreevy <mamcgree@hdfgroup.org>2010-09-10 16:15:57 (GMT)
committerMike McGreevy <mamcgree@hdfgroup.org>2010-09-10 16:15:57 (GMT)
commit2d9a70085c38816df68a1b2cfce59c05853e3c4a (patch)
tree4fd2b91f1dcf8291ab6654caa8a68eef46aff824 /test/ttsafe_acreate.c
parenta8646632e8f76b729c141d0570700bae2fa884e9 (diff)
downloadhdf5-2d9a70085c38816df68a1b2cfce59c05853e3c4a.zip
hdf5-2d9a70085c38816df68a1b2cfce59c05853e3c4a.tar.gz
hdf5-2d9a70085c38816df68a1b2cfce59c05853e3c4a.tar.bz2
[svn-r19368] Purpose:
Add windows threads support to HDF5. Description: Added calls to the windows threads library to the H5TS layer, and wrapped most calls to either pthreads or windows threads library with portable H5TS-style defines. Modified tests to use portable function definitions as well. This can be configured via CMake with the HDF5_ENABLE_THREADSAFE option, and should work on windows vista and later operating systems. Tested: h5committest, plus threadsafe with pthreads on jam and amani, and tested on a Windows Vista VM with threadsafe using windows threads.
Diffstat (limited to 'test/ttsafe_acreate.c')
-rw-r--r--test/ttsafe_acreate.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c
index 0e2c7c8..0efd02c 100644
--- a/test/ttsafe_acreate.c
+++ b/test/ttsafe_acreate.c
@@ -68,8 +68,8 @@ typedef struct acreate_data_struct {
void tts_acreate(void)
{
- /* Pthread declarations */
- pthread_t threads[NUM_THREADS];
+ /* Thread declarations */
+ H5TS_thread_t threads[NUM_THREADS];
/* HDF5 data declarations */
hid_t file, dataset;
@@ -118,13 +118,11 @@ void tts_acreate(void)
attrib_data->datatype = datatype;
attrib_data->dataspace = dataspace;
attrib_data->current_index = i;
- ret = pthread_create(&threads[i], NULL, tts_acreate_thread, attrib_data);
- assert(ret == 0);
+ threads[i] = H5TS_create_thread(tts_acreate_thread, NULL, attrib_data);
} /* end for */
for(i = 0; i < NUM_THREADS; i++) {
- ret = pthread_join(threads[i], NULL);
- assert(ret == 0);
+ H5TS_wait_for_thread(threads[i]);
} /* end for */