X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fparallel%2FWSDeque.c;fp=rts%2Fparallel%2FWSDeque.c;h=4ae9417fdbbb3ce012fa6a1b709136e8ff4382dc;hb=fbc3fc411a2b619f638612dcaf322983c7a403c3;hp=75ff9197bd8b0e53a9bf8dc6782019fe5465c323;hpb=03ef5bd295f3ba7473b3dee99691fe1b2e077a0c;p=ghc-hetmet.git diff --git a/rts/parallel/WSDeque.c b/rts/parallel/WSDeque.c index 75ff919..4ae9417 100644 --- a/rts/parallel/WSDeque.c +++ b/rts/parallel/WSDeque.c @@ -130,7 +130,14 @@ popWSDeque (WSDeque *q) b = q->bottom; /* "decrement b as a test, see what happens" */ - q->bottom = --b; + + b--; + q->bottom = b; + + // very important that the following read of q->top does not occur + // before the earlier write to q->bottom. + store_load_barrier(); + pos = (q->elements) + (b & (q->moduloSize)); t = q->top; /* using topBound would give an *upper* bound, we need a lower bound. We use the real top here, but