summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-12-01 21:45:29 -0500
committerBen Gamari <ben@smart-cactus.org>2020-11-08 09:40:53 -0500
commit3525358424419433648caba9cbf23cc13f690b26 (patch)
tree3061573fcdf1638a04c11d56ba419eb4fb9a1e52
parentf96cf570469e3b32c546f3ccf4d3a105ac6cf1da (diff)
downloadhaskell-3525358424419433648caba9cbf23cc13f690b26.tar.gz
rts/Task: Move debugTrace to avoid data race
Specifically, we need to hold all_tasks_mutex to read taskCount.
-rw-r--r--rts/Task.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/Task.c b/rts/Task.c
index 41e2bb99c3..2bd32359cc 100644
--- a/rts/Task.c
+++ b/rts/Task.c
@@ -238,6 +238,8 @@ newTask (bool worker)
all_tasks = task;
taskCount++;
+ debugTrace(DEBUG_sched, "new task (taskCount: %d)", taskCount);
+
if (worker) {
workerCount++;
currentWorkerCount++;
@@ -312,8 +314,6 @@ newBoundTask (void)
task->stopped = false;
newInCall(task);
-
- debugTrace(DEBUG_sched, "new task (taskCount: %d)", taskCount);
return task;
}