File tree 1 file changed +4
-1
lines changed
warp/Network/Wai/Handler/Warp
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import Control.Concurrent
10
10
import qualified Control.Exception
11
11
12
12
import Network.Wai.Handler.Warp.Imports
13
+ import GHC.Conc (labelThread )
13
14
14
15
-- | Allow main socket listening thread to be interrupted on Windows platform
15
16
--
@@ -18,7 +19,9 @@ windowsThreadBlockHack :: IO a -> IO a
18
19
windowsThreadBlockHack act = do
19
20
var <- newEmptyMVar :: IO (MVar (Either Control.Exception. SomeException a ))
20
21
-- Catch and rethrow even async exceptions, so don't bother with UnliftIO
21
- void . forkIO $ Control.Exception. try act >>= putMVar var
22
+ void . forkIO $ do
23
+ myThreadId >>= flip labelThread " Windows Thread Block Hack (warp)"
24
+ Control.Exception. try act >>= putMVar var
22
25
res <- takeMVar var
23
26
case res of
24
27
Left e -> Control.Exception. throwIO e
You can’t perform that action at this time.
0 commit comments