summaryrefslogtreecommitdiff
path: root/rts/STM.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-05-19 13:29:42 -0400
committerBen Gamari <ben@smart-cactus.org>2019-10-21 11:43:54 -0400
commit26c3827f0b878f5bde7b5261076eb8452847fdb4 (patch)
tree45d7ab2d4c838f555fe605a8ef16aec69f703fe4 /rts/STM.c
parent1037341648466158fd55bd1d50e1f81c8cfd1516 (diff)
downloadhaskell-26c3827f0b878f5bde7b5261076eb8452847fdb4.tar.gz
Nonmoving: Ensure write barrier vanishes in non-threaded RTS
Diffstat (limited to 'rts/STM.c')
-rw-r--r--rts/STM.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/rts/STM.c b/rts/STM.c
index c17f33aaa0..1dde70b485 100644
--- a/rts/STM.c
+++ b/rts/STM.c
@@ -297,8 +297,10 @@ static StgClosure *lock_tvar(Capability *cap,
} while (cas((void *)&(s -> current_value),
(StgWord)result, (StgWord)trec) != (StgWord)result);
- if (RTS_UNLIKELY(nonmoving_write_barrier_enabled && result)) {
- updateRemembSetPushClosure(cap, result);
+
+ IF_NONMOVING_WRITE_BARRIER_ENABLED {
+ if (result)
+ updateRemembSetPushClosure(cap, result);
}
return result;
}
@@ -323,8 +325,9 @@ static StgBool cond_lock_tvar(Capability *cap,
TRACE("%p : cond_lock_tvar(%p, %p)", trec, s, expected);
w = cas((void *)&(s -> current_value), (StgWord)expected, (StgWord)trec);
result = (StgClosure *)w;
- if (RTS_UNLIKELY(nonmoving_write_barrier_enabled && result)) {
- updateRemembSetPushClosure(cap, expected);
+ IF_NONMOVING_WRITE_BARRIER_ENABLED {
+ if (result)
+ updateRemembSetPushClosure(cap, expected);
}
TRACE("%p : %s", trec, result ? "success" : "failure");
return (result == expected);