use uninterruptibleMask

Some recent changes to use mask missed that async exceptions can still
be thrown inside it. The goal is to make sure a block of cleanup code
runs entirely, w/o being interrupted by an async exception, so use
uninterruptibleMask.

Also, converted a few to bracket, which is nicer.
This commit is contained in:
Joey Hess 2020-06-09 13:48:48 -04:00
parent 7013798df5
commit 24ff5e2b29
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 7 additions and 7 deletions

View file

@ -94,5 +94,4 @@ tryPidLock m f posixlock = debugLocks $ liftIO . go =<< pidLockFile
-- avoid complicating any code that might expect to be able to see that
-- lock file. But, it's not locked.
dummyPosixLock :: Maybe FileMode -> LockFile -> IO ()
dummyPosixLock m f = mask $ const $
closeFd =<< openLockFile ReadLock m f
dummyPosixLock m f = bracket (openLockFile ReadLock m f) closeFd (const noop)