Commit Graph

12 Commits

Author SHA1 Message Date
Quincey Koziol
d35daa45e9 Trim trailing whitespace 2020-05-20 09:37:19 -05:00
David Young
4bbd9649c0 Complete the comment on thread_main(), explaining why the barrier is used. 2020-05-20 09:31:55 -05:00
David Young
4562a584af The first implementation seemed to allow for the possibility that a thread
could block at the barrier, wake and exit the barrier, re-acquire the barrier
lock and increase `nentered` before the other blocked threads woke and checked
`nentered % count == 0`.  Then the other blocked threads would check `nentered
% count == 0` and, finding it false, go back to sleep in the barrier.  This new
implementation waits for a looser condition to obtain so that threads don't go
back to sleep in the barrier.
2020-05-20 09:31:55 -05:00
David Young
88920baf53 Test the right condition for the EBUSY return in pthread_barrier_destroy(). 2020-05-20 09:31:55 -05:00
David Young
b7f27e0381 s/exit_failure/EXIT_FAILURE/g 2020-05-20 09:31:55 -05:00
David Young
8c5e0a1e53 Implement pthread_barrier(3) for Darwin using a counter, condition variable,
and mutex.  Untested.
2020-05-20 09:31:55 -05:00
David Young
5640d832e4 Use HD prefix. 2020-05-20 09:31:55 -05:00
David Young
50d7f83e6e Provide local copies of err(3)- and errx(3)-alike functions
for Visual Studio compatibility.
2020-05-20 09:31:55 -05:00
David Young
f6bf61975e Oops, the test has to return success in the unimplemented case. 2020-05-20 09:31:54 -05:00
David Young
cc57aa73c8 src/H5Eint.c: #include H5TSprivate.h for H5TS_thread_id() definitions.
test/thread_id.c: move threads_failure() inside #ifdefs.
2020-05-20 09:31:54 -05:00
David Young
364a277143 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.
2020-05-20 09:31:54 -05:00
David Young
06dfd6025d Replace pthread_self_ulong() with H5TS_thread_id(). The POSIX Threads
implementation ought to be portable to any system that has POSIX
Threads.  On Windows, I use the same API call as before.
2020-05-20 09:31:54 -05:00