diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-09-27 18:52:15 +0000 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-10-24 21:00:37 -0400 |
commit | 8d2b3c3d1fcb9009b6dfcce85777e04bcec9d219 (patch) | |
tree | 21abdb46f64f1608d983a89dd7643d2431513212 /rts/Capability.c | |
parent | 811f915db3b682f33aad2c3e6ca039a6e8451c69 (diff) | |
download | haskell-8d2b3c3d1fcb9009b6dfcce85777e04bcec9d219.tar.gz |
rts: Eliminate data races on pending_sync
Diffstat (limited to 'rts/Capability.c')
-rw-r--r-- | rts/Capability.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/Capability.c b/rts/Capability.c index 0b5f009800..5ebe6c8b46 100644 --- a/rts/Capability.c +++ b/rts/Capability.c @@ -544,7 +544,7 @@ releaseCapability_ (Capability* cap, // be currently in waitForCapability() waiting for this // capability, in which case simply setting it as free would not // wake up the waiting task. - PendingSync *sync = pending_sync; + PendingSync *sync = SEQ_CST_LOAD(&pending_sync); if (sync && (sync->type != SYNC_GC_PAR || sync->idle[cap->no])) { debugTrace(DEBUG_sched, "sync pending, freeing capability %d", cap->no); return; @@ -906,7 +906,7 @@ yieldCapability (Capability** pCap, Task *task, bool gcAllowed) if (gcAllowed) { - PendingSync *sync = pending_sync; + PendingSync *sync = SEQ_CST_LOAD(&pending_sync); if (sync) { switch (sync->type) { |