summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-02-03 22:23:06 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2020-05-06 20:37:42 (GMT)
commit524af38af8877957308832dbe346aa84c7dea356 (patch)
treecc458a85aa3703e9caa8db0f5ce050615429f6ea /test
parentbb3e1a5cafd0c35358e341836b758ea3b747f495 (diff)
downloadhdf5-524af38af8877957308832dbe346aa84c7dea356.zip
hdf5-524af38af8877957308832dbe346aa84c7dea356.tar.gz
hdf5-524af38af8877957308832dbe346aa84c7dea356.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 3f18a7f..ce573de 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1165,7 +1165,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;