summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-11-07 22:38:50 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-12-16 16:12:44 -0500
commit2228c999059f6bd10fb85476174180da2a7190da (patch)
tree9889139bf85d066d1e8c4f830c4c14ee7da4f5f5
parent821b5472918f1f1686c44b300eac6f6718369379 (diff)
downloadhaskell-2228c999059f6bd10fb85476174180da2a7190da.tar.gz
rts/stm: Fix memory ordering in readTVarIO#
See #22421.
-rw-r--r--rts/PrimOps.cmm3
1 files changed, 1 insertions, 2 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index fc2b13962d..2f7f12df84 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -1580,9 +1580,8 @@ stg_readTVarIOzh ( P_ tvar /* :: TVar a */ )
W_ result, resultinfo;
again:
- result = StgTVar_current_value(tvar);
+ result = %acquire StgTVar_current_value(tvar);
resultinfo = %INFO_PTR(result);
- prim_read_barrier;
if (resultinfo == stg_TREC_HEADER_info) {
goto again;
}