Skip to content

Commit

Permalink
Change the cleanup test and make all releases uninterruptible
Browse files Browse the repository at this point in the history
  • Loading branch information
ndmitchell committed Feb 1, 2020
1 parent 1ad2af1 commit cb952fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/General/Cleanup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ unprotect :: ReleaseKey -> IO ()
unprotect (ReleaseKey ref i) = atomicModifyIORef' ref $ \s -> (s{items = Map.delete i $ items s}, ())

release :: ReleaseKey -> IO ()
release (ReleaseKey ref i) = mask_ $ do
release (ReleaseKey ref i) = uninterruptibleMask_ $ do
undo <- atomicModifyIORef' ref $ \s -> (s{items = Map.delete i $ items s}, Map.lookup i $ items s)
fromMaybe (return ()) undo

Expand Down
2 changes: 1 addition & 1 deletion src/Test/Cleanup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ main = testSimple $ do
do -- cleanup actions are masked https://github.com/snoyberg/conduit/issues/144
let checkMasked name = do
ms <- getMaskingState
unless (ms == MaskedInterruptible) $
unless (ms == MaskedUninterruptible) $
error $ show (name, ms)
withCleanup $ \cleanup -> do
register cleanup (checkMasked "release") >>= release
Expand Down

0 comments on commit cb952fa

Please sign in to comment.