anchor.diff:              R
       end.
   
  +%% @spec checkin(atom(), pid()) -> ok
  +%% @doc Check a connection back into the pool.
   checkin(Name, Conn) ->
       gen_server:cast(Name, {checkin, Conn}).
   
  +%% @spec current_count(atom()) -> integer()
  +%% @doc Get the number of connections currently available to be
  +%%      checked out
   current_count(Name) ->
       gen_server:call(Name, current_count, infinity).
   
  
positive.code: 
  exit_test() ->
      ConnCount = 5,
      {ok, Pool} = start_link(sock_pool_ut, {?MODULE, ?MODULE}, fun() -> ConnCount end),
      try
          %% Lazy evaluation - does not open pool until first use
          ?assertEqual(0, ?MODULE:current_count(sock_pool_ut)),
  
negative.code: -export([new_conn/0]). % for unit testing
  -endif.
  
  %% wait up to 250ms before trying to checkout a connection again
  -define(MAX_RETRY_WAIT, 250).
  
  -record(state,
          {
            pool=[],          %% available connections
            openmod,          %% module to use to start connections
            closemod,         %% module to use to close connections
            countfun,         %% how many connections to start
            initialized=false %% have any conns been inited?
           }).
  
  %% thanks to Tony Rogvall for the idea
  -record('DOWN',
  