Commit 8dab89b4 authored by Ben Gamari's avatar Ben Gamari 🐢

rts: Note functions which must take all_tasks_mutex.

parent e261b852
......@@ -498,6 +498,9 @@ giveCapabilityToTask (Capability *cap USED_IF_DEBUG, Task *task)
*
* The current Task (cap->task) releases the Capability. The Capability is
* marked free, and if there is any work to do, an appropriate Task is woken up.
*
* N.B. May need to take all_tasks_mutex.
*
* ------------------------------------------------------------------------- */
#if defined(THREADED_RTS)
......
......@@ -2005,6 +2005,7 @@ forkProcess(HsStablePtr *entry
RELEASE_LOCK(&task->lock);
#if defined(THREADED_RTS)
/* N.B. releaseCapability_ below may need to take all_tasks_mutex */
RELEASE_LOCK(&all_tasks_mutex);
#endif
......
......@@ -199,6 +199,7 @@ freeTask (Task *task)
stgFree(task);
}
/* Must take all_tasks_mutex */
static Task*
newTask (bool worker)
{
......@@ -443,6 +444,7 @@ workerStart(Task *task)
scheduleWorker(cap,task);
}
/* N.B. must take all_tasks_mutex */
void
startWorkerTask (Capability *cap)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment