summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-02-03 22:23:06 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-20 14:31:54 (GMT)
commit364a27714358e0f28d92f2f0efed85ab64a9cc05 (patch)
tree601ac728c9ff2f13ed7482c8893c946c3eba41a6 /test
parent5178dd70ec699eb855ddedb81fc144f48c612520 (diff)
downloadhdf5-364a27714358e0f28d92f2f0efed85ab64a9cc05.zip
hdf5-364a27714358e0f28d92f2f0efed85ab64a9cc05.tar.gz
hdf5-364a27714358e0f28d92f2f0efed85ab64a9cc05.tar.bz2
Change thread IDs to uint64_t from unsigned long, per Quincey's suggestion.
Fix a typo in the H5TS_thread_init() comment and reword some ID properties.
Diffstat (limited to 'test')
-rw-r--r--test/h5test.c2
-rw-r--r--test/thread_id.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/test/h5test.c b/test/h5test.c
index 037e114..ab57370 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1184,7 +1184,7 @@ h5_show_hostname(void)
HDprintf("thread 0.");
}
#else
- HDprintf("thread %lu.", H5TS_thread_id());
+ HDprintf("thread %" PRIu64 ".", H5TS_thread_id());
#endif
#ifdef H5_HAVE_WIN32_API
diff --git a/test/thread_id.c b/test/thread_id.c
index 711a21b..75ffe17 100644
--- a/test/thread_id.c
+++ b/test/thread_id.c
@@ -71,29 +71,30 @@ atomic_printf(const char *fmt, ...)
static void *
thread_main(void H5_ATTR_UNUSED *arg)
{
- unsigned long ntid, tid;
+ uint64_t ntid, tid;
tid = H5TS_thread_id();
if (tid < 1 || NTHREADS < tid) {
- atomic_printf("unexpected tid %lu FAIL\n", tid);
+ atomic_printf("unexpected tid %" PRIu64 " FAIL\n", tid);
goto pre_barrier_error;
}
pthread_mutex_lock(&used_lock);
if (used[tid - 1]) {
- atomic_printf("reused tid %lu FAIL\n", tid);
+ atomic_printf("reused tid %" PRIu64 " FAIL\n", tid);
pthread_mutex_unlock(&used_lock);
goto pre_barrier_error;
}
used[tid - 1] = true;
pthread_mutex_unlock(&used_lock);
- atomic_printf("tid %lu in [1, %d] PASS\n", tid, NTHREADS);
+ atomic_printf("tid %" PRIu64 " in [1, %d] PASS\n", tid, NTHREADS);
pthread_barrier_wait(&barrier);
ntid = H5TS_thread_id();
if (ntid != tid) {
- atomic_printf("tid changed from %lu to %lu FAIL\n", tid, ntid);
+ atomic_printf("tid changed from %" PRIu64 " to %" PRIu64 " FAIL\n",
+ tid, ntid);
failed = true;
}
return NULL;