pth: Use barriers in pthread tests
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 27 Jan 2017 23:38:08 +0000 (18:38 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 9 Feb 2017 17:31:09 +0000 (12:31 -0500)
commit4892c61493728b61dc3a91459f5bf8a218e118af
tree202a1fe49e20e6c7466e158e8ea787c5b5671a24
parent2421faec33ab0cfb1ca6aceab1a767810688d9c6
pth: Use barriers in pthread tests

The use of 'ready' like that assumes that the creator will not block in
between the time it creates the last thread and it hits ready.  It could
block, for instance, on an mmap/malloc.  At that point, the other N threads
would run on the N vcores.  Since pthreads is non-preemptive currently,
thread0 would never run to set 'ready'.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tests/pthread_switch.c
tests/pthread_test.c