X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FMessages.c;h=f7cb809351306723295e1da20a9bef7e252bcfe2;hb=7a3c2d0e25befca7f83f448c12d5310c2ffd86fa;hp=91ee9a6574efe195bb63077a274e485db9104bfc;hpb=b2e840ee0c95fb549d40950f43cc6e4afc177a46;p=ghc-hetmet.git diff --git a/rts/Messages.c b/rts/Messages.c index 91ee9a6..f7cb809 100644 --- a/rts/Messages.c +++ b/rts/Messages.c @@ -161,7 +161,7 @@ nat messageBlackHole(Capability *cap, MessageBlackHole *msg) const StgInfoTable *info; StgClosure *p; StgBlockingQueue *bq; - StgClosure *bh = msg->bh; + StgClosure *bh = UNTAG_CLOSURE(msg->bh); StgTSO *owner; debugTraceCap(DEBUG_sched, cap, "message: thread %d blocking on blackhole %p", @@ -186,7 +186,9 @@ nat messageBlackHole(Capability *cap, MessageBlackHole *msg) // The blackhole must indirect to a TSO, a BLOCKING_QUEUE, an IND, // or a value. loop: - p = UNTAG_CLOSURE(((StgInd*)bh)->indirectee); + // NB. VOLATILE_LOAD(), because otherwise gcc hoists the load + // and turns this into an infinite loop. + p = UNTAG_CLOSURE((StgClosure*)VOLATILE_LOAD(&((StgInd*)bh)->indirectee)); info = p->header.info; if (info == &stg_IND_info)