diff options
| author | Ben Gamari <ben@smart-cactus.org> | 2022-11-16 00:14:24 -0500 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2023-04-12 07:42:54 -0400 |
| commit | 96423b6900ef567a9353e19f99b6f70117a576f8 (patch) | |
| tree | f5a34ca8cfe48c89a7b671144549e33458d2dc67 | |
| parent | 6df6dec3648684069f4a392a501d9defef8987ec (diff) | |
| download | haskell-96423b6900ef567a9353e19f99b6f70117a576f8.tar.gz | |
nonmoving: Ensure that we aren't holding locks when closing them
TSAN complains about this sort of thing.
(cherry picked from commit 71aea6d3160e1389c38bb94c281bd7c30a030147)
| -rw-r--r-- | rts/sm/NonMoving.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rts/sm/NonMoving.c b/rts/sm/NonMoving.c index fe8e89ed76..d5963658ed 100644 --- a/rts/sm/NonMoving.c +++ b/rts/sm/NonMoving.c @@ -754,7 +754,7 @@ void nonmovingStop(void) "waiting for nonmoving collector thread to terminate"); ACQUIRE_LOCK(&concurrent_coll_finished_lock); waitCondition(&concurrent_coll_finished, &concurrent_coll_finished_lock); - ACQUIRE_LOCK(&nonmoving_collection_mutex); + RELEASE_LOCK(&concurrent_coll_finished_lock); } #endif } @@ -767,6 +767,9 @@ void nonmovingExit(void) nonmovingStop(); #if defined(THREADED_RTS) + ACQUIRE_LOCK(&nonmoving_collection_mutex); + RELEASE_LOCK(&nonmoving_collection_mutex); + closeMutex(&concurrent_coll_finished_lock); closeCondition(&concurrent_coll_finished); closeMutex(&nonmoving_collection_mutex); |
