diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-11-01 13:10:01 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-11-01 13:10:01 -0500 |
commit | b8e66e0eecdc58ec5fea0b2c9a9454d38858886c (patch) | |
tree | 7d25f3ee8f2b714175d1b5647d9aec1fdb550cc1 /rts/Capability.h | |
parent | b4686bff56377a583f0605b81fae290d3fee4c4a (diff) | |
parent | 3a18155331e07e53b9f3b1d987ed430066b17aa4 (diff) | |
download | haskell-b8e66e0eecdc58ec5fea0b2c9a9454d38858886c.tar.gz |
Merge branch 'wip/tsan/storage' into wip/tsan/all
Diffstat (limited to 'rts/Capability.h')
-rw-r--r-- | rts/Capability.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rts/Capability.h b/rts/Capability.h index bc2e48412a..8c5b1e814e 100644 --- a/rts/Capability.h +++ b/rts/Capability.h @@ -419,14 +419,16 @@ recordMutableCap (const StgClosure *p, Capability *cap, uint32_t gen) // ASSERT(cap->running_task == myTask()); // NO: assertion is violated by performPendingThrowTos() bd = cap->mut_lists[gen]; - if (bd->free >= bd->start + BLOCK_SIZE_W) { + if (RELAXED_LOAD(&bd->free) >= bd->start + BLOCK_SIZE_W) { bdescr *new_bd; new_bd = allocBlockOnNode_lock(cap->node); new_bd->link = bd; + new_bd->free = new_bd->start; bd = new_bd; cap->mut_lists[gen] = bd; } - *bd->free++ = (StgWord)p; + RELAXED_STORE(bd->free, (StgWord) p); + NONATOMIC_ADD(&bd->free, 1); } EXTERN_INLINE void |