summaryrefslogtreecommitdiff
path: root/rts/Task.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/Task.c')
-rw-r--r--rts/Task.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/rts/Task.c b/rts/Task.c
index b6092e5e41..6c814886ba 100644
--- a/rts/Task.c
+++ b/rts/Task.c
@@ -321,6 +321,11 @@ discardTasksExcept (Task *keep)
next = task->all_next;
if (task != keep) {
debugTrace(DEBUG_sched, "discarding task %" FMT_SizeT "", (size_t)TASK_ID(task));
+ // Note that we do not traceTaskDelete here because
+ // we are not really deleting a task.
+ // The OS threads for all these tasks do not exist in
+ // this process (since we're currently
+ // in the child of a forkProcess).
freeTask(task);
}
}
@@ -383,6 +388,8 @@ workerTaskStop (Task *task)
RELEASE_LOCK(&all_tasks_mutex);
+ traceTaskDelete(task);
+
freeTask(task);
}
@@ -425,6 +432,9 @@ workerStart(Task *task)
newInCall(task);
+ // Everything set up; emit the event before the worker starts working.
+ traceTaskCreate(task, cap);
+
scheduleWorker(cap,task);
}
@@ -443,6 +453,8 @@ startWorkerTask (Capability *cap)
// worker thread reads it.
ACQUIRE_LOCK(&task->lock);
+ // We don't emit a task creation event here, but in workerStart,
+ // where the kernel thread id is known.
task->cap = cap;
// Give the capability directly to the worker; we can't let anyone