Skip to content

Commit 18f223a

Browse files
committed
io-sim: label Async's TVar
The monadic action of Async is baked by a TVar. Naming it helps debuging deadlocks.
1 parent ee4dc47 commit 18f223a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

io-sim/src/Control/Monad/IOSim/Internal.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ instance MonadAsync (IOSim s) where
428428
var <- newEmptyTMVarIO
429429
tid <- mask $ \restore ->
430430
forkIO $ try (restore action) >>= atomically . putTMVar var
431+
labelTMVarIO var ("async-" ++ show tid)
431432
return (Async tid (readTMVar var))
432433

433434
asyncThreadId _proxy (Async tid _) = tid

0 commit comments

Comments
 (0)