Commit 8a317b22 authored by Simon Marlow's avatar Simon Marlow
Browse files

putMVar and takeMVar: add write_barrier() to fix race with throwTo

parent b55e7b53
......@@ -1651,8 +1651,11 @@ takeMVarzh_fast
CurrentTSO) [];
}
StgTSO__link(CurrentTSO) = stg_END_TSO_QUEUE_closure;
StgTSO_why_blocked(CurrentTSO) = BlockedOnMVar::I16;
StgTSO_block_info(CurrentTSO) = mvar;
// write barrier for throwTo(), which looks at block_info
// if why_blocked==BlockedOnMVar.
prim %write_barrier() [];
StgTSO_why_blocked(CurrentTSO) = BlockedOnMVar::I16;
StgMVar_tail(mvar) = CurrentTSO;
R1 = mvar;
......@@ -1808,8 +1811,11 @@ putMVarzh_fast
CurrentTSO) [];
}
StgTSO__link(CurrentTSO) = stg_END_TSO_QUEUE_closure;
StgTSO_why_blocked(CurrentTSO) = BlockedOnMVar::I16;
StgTSO_block_info(CurrentTSO) = mvar;
// write barrier for throwTo(), which looks at block_info
// if why_blocked==BlockedOnMVar.
prim %write_barrier() [];
StgTSO_why_blocked(CurrentTSO) = BlockedOnMVar::I16;
StgMVar_tail(mvar) = CurrentTSO;
R1 = mvar;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment