diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2020-12-18 17:26:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-18 17:26:04 (GMT) |
commit | 353665f95e57a393070ae854685025e6bc7585e7 (patch) | |
tree | 1f835c49e4cf2a00a0f2f027ab0382a00853decb | |
parent | fc25149041037a3b8ece4cb103340a6f1ff2a0d1 (diff) | |
download | hdf5-353665f95e57a393070ae854685025e6bc7585e7.zip hdf5-353665f95e57a393070ae854685025e6bc7585e7.tar.gz hdf5-353665f95e57a393070ae854685025e6bc7585e7.tar.bz2 |
Brings changes to ttsafe_attr_vlen.c from develop (#202)
* Brings changes to ttsafe_attr_vlen.c from develop
Fix for exposed pthreads code that causes Windows builds to fail.
* Restores license URL in ttsafe_attr_vlen.c
-rw-r--r-- | test/ttsafe_attr_vlen.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/test/ttsafe_attr_vlen.c b/test/ttsafe_attr_vlen.c index f9ca1f8..ecd0aa6 100644 --- a/test/ttsafe_attr_vlen.c +++ b/test/ttsafe_attr_vlen.c @@ -54,15 +54,15 @@ void *tts_attr_vlen_thread(void *); void tts_attr_vlen(void) { - pthread_t threads[NUM_THREADS] = {0}; /* Thread declaration */ - hid_t fid = H5I_INVALID_HID; /* File ID */ - hid_t gid = H5I_INVALID_HID; /* Group ID */ - hid_t atid = H5I_INVALID_HID; /* Datatype ID for attribute */ - hid_t asid = H5I_INVALID_HID; /* Dataspace ID for attribute */ - hid_t aid = H5I_INVALID_HID; /* The attribute ID */ - char * string_attr = "2.0"; /* The attribute data */ - int ret; /* Return value */ - int i; /* Local index variable */ + H5TS_thread_t threads[NUM_THREADS] = {0}; /* Thread declaration */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t atid = H5I_INVALID_HID; /* Datatype ID for attribute */ + hid_t asid = H5I_INVALID_HID; /* Dataspace ID for attribute */ + hid_t aid = H5I_INVALID_HID; /* The attribute ID */ + const char * string_attr = "2.0"; /* The attribute data */ + int ret; /* Return value */ + int i; /* Local index variable */ /* Create the HDF5 test file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -106,26 +106,27 @@ tts_attr_vlen(void) CHECK(ret, H5I_INVALID_HID, "H5Tclose"); /* Start multiple threads and execute tts_attr_vlen_thread() for each thread */ - for (i = 0; i < NUM_THREADS; i++) - pthread_create(&threads[i], NULL, tts_attr_vlen_thread, NULL); + for (i = 0; i < NUM_THREADS; i++) { + threads[i] = H5TS_create_thread(tts_attr_vlen_thread, NULL, NULL); + } /* Wait for the threads to end */ for (i = 0; i < NUM_THREADS; i++) - pthread_join(threads[i], NULL); + H5TS_wait_for_thread(threads[i]); } /* end tts_attr_vlen() */ /* Start execution for each thread */ void * -tts_attr_vlen_thread(void *client_data) +tts_attr_vlen_thread(void H5_ATTR_UNUSED *client_data) { - hid_t fid = H5I_INVALID_HID; /* File ID */ - hid_t gid = H5I_INVALID_HID; /* Group ID */ - hid_t aid = H5I_INVALID_HID; /* Attribute ID */ - hid_t atid = H5I_INVALID_HID; /* Datatype ID for the attribute */ - char * string_attr_check; /* The attribute data being read */ - char * string_attr = "2.0"; /* The expected attribute data */ - herr_t ret; /* Return value */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t atid = H5I_INVALID_HID; /* Datatype ID for the attribute */ + char * string_attr_check; /* The attribute data being read */ + const char *string_attr = "2.0"; /* The expected attribute data */ + herr_t ret; /* Return value */ /* Open the test file */ fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT); |