Skip to content

Commit

Permalink
Merge PR #92
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Sep 28, 2023
2 parents 6b2d357 + f093214 commit c2a2994
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Network/HTTP2/Arch/Manager.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}

-- | A thread manager.
-- The manager has responsibility to spawn and kill
Expand Down Expand Up @@ -107,9 +108,10 @@ forkManagedUnmask :: Manager -> ((forall x. IO x -> IO x) -> IO ()) -> IO ()
forkManagedUnmask mgr io =
void $ mask_ $ forkIOWithUnmask $ \unmask -> do
addMyId mgr
r <- io unmask `onException` deleteMyId mgr
-- We catch the exception and do not rethrow it: we don't want the
-- exception printed to stderr.
io unmask `catch` \(_e :: SomeException) -> return ()
deleteMyId mgr
return r

-- | Adding my thread id to the kill-thread list on stopping.
--
Expand Down

0 comments on commit c2a2994

Please sign in to comment.