summaryrefslogtreecommitdiff
path: root/rts/Capability.h
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-11-01 13:10:01 -0500
committerBen Gamari <ben@smart-cactus.org>2020-11-01 13:10:01 -0500
commitb8e66e0eecdc58ec5fea0b2c9a9454d38858886c (patch)
tree7d25f3ee8f2b714175d1b5647d9aec1fdb550cc1 /rts/Capability.h
parentb4686bff56377a583f0605b81fae290d3fee4c4a (diff)
parent3a18155331e07e53b9f3b1d987ed430066b17aa4 (diff)
downloadhaskell-b8e66e0eecdc58ec5fea0b2c9a9454d38858886c.tar.gz
Merge branch 'wip/tsan/storage' into wip/tsan/all
Diffstat (limited to 'rts/Capability.h')
-rw-r--r--rts/Capability.h6
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