diff options
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r-- | rts/PrimOps.cmm | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 6081fabe93..058fe1e30c 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -1825,18 +1825,14 @@ stg_readMVarzh ( P_ mvar, /* :: MVar a */ ) stg_tryReadMVarzh ( P_ mvar, /* :: MVar a */ ) { - W_ val, info, tso, q; + W_ val; - LOCK_CLOSURE(mvar, info); + val = StgMVar_value(mvar); - if (StgMVar_value(mvar) == stg_END_TSO_QUEUE_closure) { - unlockClosure(mvar, info); + if (val == stg_END_TSO_QUEUE_closure) { return (0, stg_NO_FINALIZER_closure); } - val = StgMVar_value(mvar); - - unlockClosure(mvar, info); return (1, val); } |