Skip to content

Commit

Permalink
network-mux: forkJob return Async
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed May 4, 2021
1 parent 4fd6231 commit 73d48c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion network-mux/src/Control/Concurrent/JobPool.hs
Expand Up @@ -58,7 +58,7 @@ forkJob :: forall m a.
(MonadAsync m, MonadMask m)
=> JobPool m a
-> Job m a
-> m ()
-> m (Async m ())
forkJob JobPool{jobsVar, completionQueue} (Job action handler label) =
mask $ \restore -> do
jobAsync <- async $ do
Expand All @@ -72,6 +72,7 @@ forkJob JobPool{jobsVar, completionQueue} (Job action handler label) =

let !tid = asyncThreadId (Proxy :: Proxy m) jobAsync
atomically $ modifyTVar' jobsVar (Map.insert tid jobAsync)
return jobAsync
where
notAsyncExceptions :: SomeException -> Maybe SomeException
notAsyncExceptions e
Expand Down

0 comments on commit 73d48c0

Please sign in to comment.