Skip to content

Commit

Permalink
More notes on why uninteruptible makes sense
Browse files Browse the repository at this point in the history
  • Loading branch information
ndmitchell committed Feb 1, 2020
1 parent 5d991fe commit 1ad2af1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/General/Cleanup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ newCleanup = do
-- important to use uninterruptibleMask_ otherwise in things like allocateThread
-- we might end up being interrupted and failing to close down the thread
-- e.g. see https://github.com/digital-asset/ghcide/issues/381
-- note that packages like safe-exceptions also use uninterruptibleMask_
let clean = uninterruptibleMask_ $ do
items <- atomicModifyIORef' ref $ \s -> (s{items=Map.empty}, items s)
mapM_ snd $ sortOn (negate . fst) $ Map.toList items
Expand Down

0 comments on commit 1ad2af1

Please sign in to comment.