Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Reuse live resources instead of always creating new ones

  • Loading branch information...
commit fced184eb3e965c2a4060c66f1e8de340bbca9fe 1 parent 5a098d7
@ozataman ozataman authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  Data/Pool.hs
View
2  Data/Pool.hs
@@ -172,7 +172,7 @@ withResource Pool{..} act = do
resource <- liftIO . join . atomically $ do
ents <- readTVar entries
case ents of
- (Entry{..}:es) -> writeTVar entries es >> return create
+ (Entry{..}:es) -> writeTVar entries es >> return (return entry)
[] -> do
used <- readTVar inUse
when (used == maxResources) retry
Please sign in to comment.
Something went wrong with that request. Please try again.