Commit e261b852 authored by Ömer Sinan Ağacan's avatar Ömer Sinan Ağacan Committed by Ben Gamari

forkProcess: fix task mutex release order

`all_tasks_mutex` should be released before calling `releaseCapability_`
in the parent process as `releaseCapability_` spawns worker tasks in
some cases.

Reviewers: bgamari, erikd, simonmar

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14538

Differential Revision: https://phabricator.haskell.org/D4460
parent b8f03bbe
......@@ -2004,15 +2004,15 @@ forkProcess(HsStablePtr *entry
RELEASE_LOCK(&stable_mutex);
RELEASE_LOCK(&task->lock);
#if defined(THREADED_RTS)
RELEASE_LOCK(&all_tasks_mutex);
#endif
for (i=0; i < n_capabilities; i++) {
releaseCapability_(capabilities[i],false);
RELEASE_LOCK(&capabilities[i]->lock);
}
#if defined(THREADED_RTS)
RELEASE_LOCK(&all_tasks_mutex);
#endif
boundTaskExiting(task);
// just return the pid
......
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