Permalink
Browse files

Switch from MonadCatchIO-transformers to monad-control.

Apparently MonadCatchIO-transformers is quite buggy :-(
  • Loading branch information...
1 parent 98b400e commit 3842ef693d231438b3d97df36cf4bc11f7772d74 @bos committed Jul 11, 2011
Showing with 5 additions and 4 deletions.
  1. +3 −2 Data/Pool.hs
  2. +2 −2 resource-pool.cabal
View
5 Data/Pool.hs
@@ -29,9 +29,10 @@ import Control.Applicative ((<$>))
import Control.Concurrent (forkIO, killThread, myThreadId, threadDelay)
import Control.Concurrent.STM
import Control.Exception (SomeException, catch)
+import Control.Exception.Control (onException)
import Control.Monad (forM_, forever, join, liftM2, unless, when)
-import Control.Monad.CatchIO (MonadCatchIO, onException)
import Control.Monad.IO.Class (liftIO)
+import Control.Monad.IO.Control (MonadControlIO)
import Data.Hashable (hash)
import Data.List (partition)
import Data.Time.Clock (NominalDiffTime, UTCTime, diffUTCTime, getCurrentTime)
@@ -164,7 +165,7 @@ reaper destroy idleTime pools = forever $ do
-- destroy a pooled resource, as doing so will almost certainly cause
-- a subsequent user (who expects the resource to be valid) to throw
-- an exception.
-withResource :: MonadCatchIO m => Pool a -> (a -> m b) -> m b
+withResource :: MonadControlIO m => Pool a -> (a -> m b) -> m b
{-# SPECIALIZE withResource :: Pool a -> (a -> IO b) -> IO b #-}
withResource Pool{..} act = do
i <- liftIO $ ((`mod` numStripes) . hash) <$> myThreadId
View
4 resource-pool.cabal
@@ -1,5 +1,5 @@
name: resource-pool
-version: 0.1.1.0
+version: 0.2.0.0
synopsis: A high-performance striped resource pooling implementation
description:
A high-performance striped pooling abstraction for managing
@@ -30,7 +30,7 @@ library
build-depends:
base == 4.*,
hashable,
- MonadCatchIO-transformers,
+ monad-control >= 0.2.0.1,
transformers,
stm,
time,

0 comments on commit 3842ef6

Please sign in to comment.