@@ -40,8 +40,7 @@ import Network.Wai.Handler.Warp.Types
4040import Data.IORef (IORef, newIORef, readIORef, writeIORef)
4141
4242#if WINDOWS
43−import qualified Control.Concurrent.MVar as MV
44−import Control.Concurrent (forkIO)
43+import Network.Wai.Handler.Warp.Windows
4544#else
4645import System.Posix.IO (FdOption(CloseOnExec), setFdOption)
4746import Network.Socket (fdSocket)
@@ -84,18 +83,6 @@ runSettings set app = withSocketsDo $
8483 setSocketCloseOnExec socket
8584 runSettingsSocket set socket app)
8685
87−#if WINDOWS
88−windowsThreadBlockHack :: IO a -> IO a
89−windowsThreadBlockHack act =
90− do
91− var <- MV.newEmptyMVar :: IO (MV.MVar (Either SomeException a))
92− void . forkIO $ E.try act >>= MV.putMVar var
93− res <- MV.takeMVar var
94− case res of
95− Left e -> throwIO e
96− Right r -> return r
97−#endif
98−
9986-- | Same as 'runSettings', but uses a user-supplied socket instead of opening
10087-- one. This allows the user to provide, for example, Unix named socket, which
10188-- can be used when reverse HTTP proxying into your application.