Lines Matching refs:pool
6 #include "ldap-connection-pool.h"
15 static void ldap_connection_list_remove(struct ldap_connection_pool *pool,
18 DLLIST_REMOVE(&pool->conn_list, list);
19 pool->conn_count--;
26 ldap_connection_pool_shrink_to(struct ldap_connection_pool *pool,
31 list = pool->conn_list;
32 for (; list != NULL && pool->conn_count > max_count; list = next) {
35 ldap_connection_list_remove(pool, list);
42 struct ldap_connection_pool *pool;
44 pool = i_new(struct ldap_connection_pool, 1);
45 pool->max_connections = max_connections;
46 return pool;
51 struct ldap_connection_pool *pool = *_pool;
55 ldap_connection_pool_shrink_to(pool, 0);
56 i_assert(pool->conn_list == NULL);
57 i_free(pool);
60 int ldap_connection_pool_get(struct ldap_connection_pool *pool,
69 for (list = pool->conn_list; list != NULL; list = list->next) {
83 DLLIST_PREPEND(&pool->conn_list, list);
84 pool->conn_count++;
86 ldap_connection_pool_shrink_to(pool, pool->max_connections);
91 void ldap_connection_pool_unref(struct ldap_connection_pool *pool,
101 ldap_connection_pool_shrink_to(pool, pool->max_connections);
104 bool ldap_connection_pool_have_references(struct ldap_connection_pool *pool)
108 for (list = pool->conn_list; list != NULL; list = list->next) {