@@ -48,9 +48,9 @@ import GHC.IO (IO (IO))
4848#endif
4949import Control.Concurrent (threadDelay, myThreadId, killThread)
5050import qualified Control.Exception as E
51−import Data.IORef (IORef)
52−import qualified Data.IORef as I
5351import GHC.Weak (Weak (..))
52+import Network.Wai.Handler.Warp.IORef (IORef)
53+import qualified Network.Wai.Handler.Warp.IORef as I
5454import Network.Wai.Handler.Warp.Thread
5555import System.Mem.Weak (deRefWeak)
5656
@@ -78,14 +78,14 @@ initialize :: Int -> IO Manager
7878initialize timeout = do
7979 ref' <- forkIOwithBreakableForever [] $ \ref -> do
8080 threadDelay timeout
81− old <- I.atomicModifyIORef ref (\x -> ([], x))
81+ old <- I.atomicModifyIORef' ref (\x -> ([], x))
8282 merge <- prune old id
83− I.atomicModifyIORef ref (\new -> (merge new, ()))
83+ I.atomicModifyIORef' ref (\new -> (merge new, ()))
8484 return $ Manager ref'
8585 where
8686 prune [] front = return front
8787 prune (m@(Handle onTimeout iactive):rest) front = do
88− state <- I.atomicModifyIORef iactive (\x -> (inactivate x, x))
88+ state <- I.atomicModifyIORef' iactive (\x -> (inactivate x, x))
8989 case state of
9090 Inactive -> do
9191 onTimeout `E.catch` ignoreAll
@@ -115,7 +115,7 @@ register :: Manager -> TimeoutAction -> IO Handle
115115register (Manager ref) onTimeout = do
116116 iactive <- I.newIORef Active
117117 let h = Handle onTimeout iactive
118− I.atomicModifyIORef ref (\x -> (h : x, ()))
118+ I.atomicModifyIORef' ref (\x -> (h : x, ()))
119119 return h
120120
121121-- | Registering a timeout action of killing this thread.