X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fparallel%2FWSDeque.c;fp=rts%2Fparallel%2FWSDeque.c;h=f77ff0987db10702af3c2a56e70c3156fdebc48b;hb=a67183b75f1527edd88b071b879c2d07e8ac7653;hp=4ae9417fdbbb3ce012fa6a1b709136e8ff4382dc;hpb=2af2966da98c9c0da9e33c6aead9e1f86f94a362;p=ghc-hetmet.git diff --git a/rts/parallel/WSDeque.c b/rts/parallel/WSDeque.c index 4ae9417..f77ff09 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