summaryrefslogtreecommitdiffstats
path: root/test/thread_id.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-02-03 22:23:06 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-02-03 22:23:06 (GMT)
commita20b68b25796d94f1159156acf97322326565c93 (patch)
treeaa5e87ba08dc68f30ce5957879114c00389aaf1a /test/thread_id.c
parent65600cbd7229340d7f5ab86dd20b35ae2dabd1ad (diff)
downloadhdf5-a20b68b25796d94f1159156acf97322326565c93.zip
hdf5-a20b68b25796d94f1159156acf97322326565c93.tar.gz
hdf5-a20b68b25796d94f1159156acf97322326565c93.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/thread_id.c')
-rw-r--r--test/thread_id.c11
1 files changed, 6 insertions, 5 deletions
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;