Skip to content

Commit 8a8789c

Browse files
committed
Label the internal thread spawned in linkOnly
1 parent 7ac0e51 commit 8a8789c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Control/Concurrent/Async/Internal.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import Data.IORef
5555

5656
import GHC.Exts
5757
import GHC.IO hiding (finally, onException)
58-
import GHC.Conc (ThreadId(..))
58+
import GHC.Conc (ThreadId(..), labelThread)
5959

6060
-- -----------------------------------------------------------------------------
6161
-- STM Async API
@@ -504,6 +504,7 @@ linkOnly
504504
linkOnly shouldThrow a = do
505505
me <- myThreadId
506506
void $ forkRepeat $ do
507+
myThreadId >>= flip labelThread ("linkOnly " ++ show (asyncThreadId a) ++ " -> " ++ show me)
507508
r <- waitCatch a
508509
case r of
509510
Left e | shouldThrow e -> throwTo me (ExceptionInLinkedThread a e)

0 commit comments

Comments
 (0)