Permalink
Browse files

Use unblock in withResource

  • Loading branch information...
1 parent 91475b5 commit dd4e8f0c48b01f3999bd13f99a3fe1cff1e069eb @norm2782 committed Mar 8, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 Data/Pool.hs
View
@@ -176,7 +176,7 @@ withResource :: MonadCatchIO m => Pool a -> (a -> m b) -> m b
{-# SPECIALIZE withResource :: Pool a -> (a -> IO b) -> IO b #-}
withResource pool act = block $ do
(resource, local) <- liftIO $ takeResource pool
- ret <- act resource `onException`
+ ret <- unblock (act resource) `onException`
liftIO (destroyResource pool local resource)
liftIO $ putResource local resource
return ret

0 comments on commit dd4e8f0

Please sign in to comment.