From 9922968dacb39bbdf18c12a6ae7d3d1b590cc7b3 Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 19 May 2026 06:54:39 +0700 Subject: [PATCH] Warden: Don't spawn new threads when canceling --- Control/Concurrent/Async/Warden.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Control/Concurrent/Async/Warden.hs b/Control/Concurrent/Async/Warden.hs index a3b19a5..013f2d0 100644 --- a/Control/Concurrent/Async/Warden.hs +++ b/Control/Concurrent/Async/Warden.hs @@ -62,7 +62,7 @@ create = Warden <$> newMVar (Just mempty) shutdown :: Warden -> IO () shutdown (Warden v) = do r <- swapMVar v Nothing - mapM_ (Async.mapConcurrently_ Async.cancel) r + mapM_ (Async.cancelMany . HashSet.toList) r forget :: Warden -> Async a -> IO () forget (Warden v) async = modifyMVar_ v $ \x -> case x of