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:
parent
7013798df5
commit
24ff5e2b29
4 changed files with 7 additions and 7 deletions
|
@ -200,7 +200,7 @@ closeP2PSshConnection :: P2PSshConnection -> IO (P2PSshConnection, Maybe ExitCod
|
|||
closeP2PSshConnection P2P.ClosedConnection = return (P2P.ClosedConnection, Nothing)
|
||||
closeP2PSshConnection (P2P.OpenConnection (_st, conn, pid, stderrhandlerst)) =
|
||||
-- mask async exceptions, avoid cleanup being interrupted
|
||||
mask $ const $ do
|
||||
uninterruptibleMask_ $ do
|
||||
P2P.closeConnection conn
|
||||
atomically $ writeTVar stderrhandlerst EndStderrHandler
|
||||
exitcode <- waitForProcess pid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue