diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-10-05 18:12:38 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-10-24 21:00:39 -0400 |
commit | dd175a926c0e9654cd6ac8d9d26b183540c87331 (patch) | |
tree | f298f5a110dfa703818948a0587f18fe9fe8b2fa /rts/Schedule.c | |
parent | bbaec97d1d3d9984736d5f6424785b1c95bd8312 (diff) | |
download | haskell-dd175a926c0e9654cd6ac8d9d26b183540c87331.tar.gz |
Document schedulePushWork race
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r-- | rts/Schedule.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c index e8bb9c1bf0..20f661ac97 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -826,14 +826,9 @@ schedulePushWork(Capability *cap USED_IF_THREADS, appendToRunQueue(free_caps[i],t); traceEventMigrateThread (cap, t, free_caps[i]->no); + // See Note [Benign data race due to work-pushing]. if (t->bound) { - // N.B. we typically would need to hold 't->bound->task->lock' to change 'cap' - // but this is safe because the Task lives on our run queue. See - // Note [Ownership of Task]. - TSAN_ANNOTATE_HAPPENS_BEFORE(&t->bound->task->cap); - // The happens-before matches the happens-after in - // waitForWorkerCapability - RELAXED_STORE(&t->bound->task->cap, free_caps[i]); + t->bound->task->cap = free_caps[i]; } t->cap = free_caps[i]; n--; // we have one fewer threads now |