Skip to content

Label a couple of internal threads #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Control/Concurrent/Async/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import Data.IORef

import GHC.Exts
import GHC.IO hiding (finally, onException)
import GHC.Conc (ThreadId(..))
import GHC.Conc (ThreadId(..), labelThread)

-- -----------------------------------------------------------------------------
-- STM Async API
Expand Down Expand Up @@ -504,6 +504,7 @@ linkOnly
linkOnly shouldThrow a = do
me <- myThreadId
void $ forkRepeat $ do
myThreadId >>= flip labelThread ("linkOnly " ++ show (asyncThreadId a) ++ " -> " ++ show me)
r <- waitCatch a
case r of
Left e | shouldThrow e -> throwTo me (ExceptionInLinkedThread a e)
Expand Down Expand Up @@ -684,6 +685,7 @@ concurrently' left right collect = do
-- putMVar.
when (count' > 0) $
void $ forkIO $ do
myThreadId >>= flip labelThread "concurrent stop"
throwTo rid AsyncCancelled
throwTo lid AsyncCancelled
-- ensure the children are really dead
Expand Down