Implement atomicReadMVar, fixing #4001.
authorEdward Z. Yang <ezyang@mit.edu>
Mon, 8 Jul 2013 18:03:35 +0000 (11:03 -0700)
committerEdward Z. Yang <ezyang@mit.edu>
Tue, 9 Jul 2013 18:29:11 +0000 (11:29 -0700)
commit70e20631742e516c6a11c3c112fbd5b4a08c15ac
treed0097f8b1c8e5c0a67b26bb950c036ea7684c65d
parentca9a431401755f119d97dec59a1fc963a8e9f681
Implement atomicReadMVar, fixing #4001.

We add the invariant to the MVar blocked threads queue that
threads blocked on an atomic read are always at the front of
the queue.  This invariant is easy to maintain, since takers
are only ever added to the end of the queue.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
15 files changed:
compiler/prelude/primops.txt.pp
includes/rts/Constants.h
includes/stg/MiscClosures.h
rts/HeapStackCheck.cmm
rts/Linker.c
rts/PrimOps.cmm
rts/RaiseAsync.c
rts/RaiseAsync.h
rts/RetainerProfile.c
rts/Schedule.c
rts/Threads.c
rts/Trace.c
rts/sm/Compact.c
rts/sm/Sanity.c
rts/sm/Scav.c