Skip to content

Commit

Permalink
connection-manager: change how masking of the cleanup function is done.
Browse files Browse the repository at this point in the history
* start the thread with masked exceptions (`asyncWithUnmask`, does not
  masks exceptions!)
* remove not needed `uninterruptibleMask_`, since the exceptions are
  already uninterruptibly masked.
  • Loading branch information
coot committed Dec 3, 2021
1 parent f58febf commit ac617dc
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -718,7 +718,7 @@ withConnectionManager ConnectionManagerArguments {
connId@ConnectionId { remoteAddress = peerAddr }
writer
handler =
asyncWithUnmask $ \unmask ->
mask $ \unmask -> async $ do
runWithUnmask
(handler socket writer
(TrConnectionHandler connId `contramap` tracer)
Expand All @@ -744,7 +744,7 @@ withConnectionManager ConnectionManagerArguments {
uninterruptibleMask $ \unmask -> do
traceWith tracer (TrConnectionCleanup connId)
mConnVar <- modifyTMVar stateVar $ \state -> do
wConnVar <- uninterruptibleMask_ $ atomically $ do
wConnVar <- atomically $ do
case Map.lookup peerAddr state of
Nothing -> return Nowhere
Just mutableConnState@MutableConnState { connVar } -> do
Expand Down

0 comments on commit ac617dc

Please sign in to comment.