Functions

srdb1/db_pool.c File Reference

Functions for managing a pool of database connections. More...

#include "../../dprint.h"
#include "db_pool.h"
Include dependency graph for srdb1/db_pool.c:

Go to the source code of this file.

Functions


Detailed Description

Definition in file srdb1/db_pool.c.


Function Documentation

struct pool_con* pool_get ( const struct db_id id  )  [read]
Parameters:
id searched id
Returns:
the connection if it could be found, NULL otherwise

Definition at line 43 of file srdb1/db_pool.c.

References cmp_db_id(), pool_con::id, pool_con::next, and pool_con::ref.

Referenced by db_do_init2().

Here is the call graph for this function:

Here is the caller graph for this function:

void pool_insert ( struct pool_con con  ) 
Parameters:
con the inserted connection

Definition at line 68 of file srdb1/db_pool.c.

References pool_con::next.

Referenced by db_do_init2().

Here is the caller graph for this function:

int pool_remove ( struct pool_con con  ) 

The function returns 0 if the connection should still be kept open because some other module is still using it. The function returns -1 if the connection is not in the pool.

Parameters:
con connection that should be removed
Returns:
1 if the connection can be freed, 0 if it can't be freed, -1 if not found

Definition at line 87 of file srdb1/db_pool.c.

References pool_con::next, and pool_con::ref.

Referenced by db_do_close().

Here is the caller graph for this function: