Skip to content

Commit

Permalink
Merge pull request comtihon#9 from avkhozov/close_pool_bug
Browse files Browse the repository at this point in the history
Added check for connection expires in resource_pool:close.
  • Loading branch information
christkv committed Aug 7, 2012
2 parents bc41adb + 5391ffc commit 4f330e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/resource_pool.erl
Expand Up @@ -42,9 +42,9 @@ get ({{Input,Create,_,IsExpired}, VResources}) ->

-spec close (pool(_)) -> ok. % IO
%@doc Close pool and all its resources
close ({{_,_,Expire,_}, VResources}) ->
close ({{_,_,Expire,IsExpired}, VResources}) ->
mvar:with (VResources, fun (Array) ->
array:map (fun (_I, MRes) -> case MRes of {Res} -> Expire (Res); {} -> ok end end, Array) end),
array:map (fun (_I, MRes) -> case MRes of {Res} -> case IsExpired (Res) of false -> Expire (Res); true -> ok end; {} -> ok end end, Array) end),
mvar:terminate (VResources).

-spec is_closed (pool(_)) -> boolean(). % IO
Expand Down

0 comments on commit 4f330e6

Please sign in to comment.