summaryrefslogtreecommitdiff
path: root/rts/parallel
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-02-11 15:24:21 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-02-11 15:24:21 +0000
commita67183b75f1527edd88b071b879c2d07e8ac7653 (patch)
treee4bf207972d58ce83500f1e4539c844c55fa77b0 /rts/parallel
parent2af2966da98c9c0da9e33c6aead9e1f86f94a362 (diff)
downloadhaskell-a67183b75f1527edd88b071b879c2d07e8ac7653.tar.gz
one more bugfix: a load/load memory barrier is required in stealWSDeque_()
Diffstat (limited to 'rts/parallel')
-rw-r--r--rts/parallel/WSDeque.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/rts/parallel/WSDeque.c b/rts/parallel/WSDeque.c
index 4ae9417fdb..f77ff0987d 100644
--- a/rts/parallel/WSDeque.c
+++ b/rts/parallel/WSDeque.c
@@ -186,8 +186,11 @@ stealWSDeque_ (WSDeque *q)
// Can't do this on someone else's spark pool:
// ASSERT_WSDEQUE_INVARIANTS(q);
- b = q->bottom;
+ // NB. these loads must be ordered, otherwise there is a race
+ // between steal and pop.
t = q->top;
+ load_load_barrier();
+ b = q->bottom;
// NB. b and t are unsigned; we need a signed value for the test
// below, because it is possible that t > b during a