diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-11-16 00:14:24 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-12-23 19:09:30 -0500 |
commit | c99367180e49d903f8be649bfdc11e95649c7d1a (patch) | |
tree | 40ba8ddf4908c3652355f0db7d530d01c27da053 /rts | |
parent | 543cae0084a72ca767a443d857f9e65a5a79f71d (diff) | |
download | haskell-c99367180e49d903f8be649bfdc11e95649c7d1a.tar.gz |
nonmoving: Ensure that we aren't holding locks when closing them
TSAN complains about this sort of thing.
Diffstat (limited to 'rts')
-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 541dfe85c5..72bfdbafa7 100644 --- a/rts/sm/NonMoving.c +++ b/rts/sm/NonMoving.c @@ -753,7 +753,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 } @@ -766,6 +766,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); |