server_db_t * server_db_pool_take(server_db_pool_t *pool, int wait_if_exhausted)
Returns a database instance / connection when successful, or NULL on failure.
If you specify a value of 1 for wait_if_exhausted the function will block when the pool is empty and cannot be expanded (pool_max has been reached). This means it will wait until a connection is available.
If you specify 0 for wait_if_exhausted the function will return immediately with NULL if the pool is empty and cannot be expanded. You'll generally want it to wait.
The pool you provide is obtained via the server_db_pool_lookup() function explained above.
When you are finished using a connection (generally, you use them for a very short period to perform a snappy little query), you must return it to the pool so it may be used again ASAP.