forkProcess: fix task mutex release order
authorÖmer Sinan Ağacan <omeragacan@gmail.com>
Fri, 2 Mar 2018 16:15:03 +0000 (11:15 -0500)
committerBen Gamari <ben@smart-cactus.org>
Fri, 2 Mar 2018 16:16:47 +0000 (11:16 -0500)
commite261b8523eb547b93b8b9e194bc2566350e7cc60
tree4d84c3b1242d3bb35aa82ef9091dc1ac4b6f9ac7
parentb8f03bbe16af7a09b494a33fbbe523ecd82f1a50
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
rts/Schedule.c