summaryrefslogtreecommitdiff
path: root/rts/Schedule.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-11-01 13:10:03 -0500
committerBen Gamari <ben@smart-cactus.org>2020-11-01 13:10:03 -0500
commit65ebf07e459733b9dfb51b02ac987411bd478841 (patch)
tree164ebe6a5ed59230e45c7c0710a080cf21854898 /rts/Schedule.c
parent375512cfbb968ed0ffbdf33153b71fab4b707dce (diff)
parentcef667b081c71008e0633d276349dd863cb46d7f (diff)
downloadhaskell-65ebf07e459733b9dfb51b02ac987411bd478841.tar.gz
Merge branch 'wip/tsan/misc' into wip/tsan/all
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r--rts/Schedule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index b97da30848..67177f2d98 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -2040,12 +2040,14 @@ forkProcess(HsStablePtr *entry
ACQUIRE_LOCK(&sm_mutex);
ACQUIRE_LOCK(&stable_ptr_mutex);
ACQUIRE_LOCK(&stable_name_mutex);
- ACQUIRE_LOCK(&task->lock);
for (i=0; i < n_capabilities; i++) {
ACQUIRE_LOCK(&capabilities[i]->lock);
}
+ // Take task lock after capability lock to avoid order inversion (#17275).
+ ACQUIRE_LOCK(&task->lock);
+
#if defined(THREADED_RTS)
ACQUIRE_LOCK(&all_tasks_mutex);
#endif