server_db_pool_give()

int server_db_pool_give(server_db_t *db)

Returns 1 on success, 0 on failure (unlikely, unless you pass NULL for db or some other programming error)

For every server_db_pool_take(), there must be a server_db_pool_give(), otherwise you are leaking instances.

This function will notify blocked takers of a instance becoming available. It is strongly recommended that you only hold onto a database instance in your code only as long as required to finish your queries, give it back as soon as you can.

In some cases you may not want to give it back, if you really don't do any IO or CPU bound work between queries the work of taking and giving can become contentious.



2007-12-06