diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-05-19 13:29:42 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-10-21 11:43:54 -0400 |
commit | 26c3827f0b878f5bde7b5261076eb8452847fdb4 (patch) | |
tree | 45d7ab2d4c838f555fe605a8ef16aec69f703fe4 /rts/STM.c | |
parent | 1037341648466158fd55bd1d50e1f81c8cfd1516 (diff) | |
download | haskell-26c3827f0b878f5bde7b5261076eb8452847fdb4.tar.gz |
Nonmoving: Ensure write barrier vanishes in non-threaded RTS
Diffstat (limited to 'rts/STM.c')
-rw-r--r-- | rts/STM.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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); |