library/src/databases/mysql/BP-DBMySQLConnectionPooling.cc
// attempts to destroy a mysql connection pool
attempts to destroy a mysql connection pool
attempts to destroy a mysql connection pool
BP_ERROR_T BP_DestroyMySQLConnectionPool(P_BP_MYSQL_CONN_POOL pool)
{
	if(!pool)
		return ERR_FAILURE;
	if(pool->entries)
	{
		size_t n = 0;
		for(; n < pool->entries_total; n++)
		{
			sem_destroy(&pool->entries[n].lock);
			BP_MySQLClose(pool->entries[n].conn);
		}
	}
	BP_DestroyLinkL(pool->tq, BP_TRUE);
	sem_destroy(&pool->lock);
	bpfree(pool);
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DestroyMySQLConnectionPool ( P_BP_MYSQL_CONN_POOL pool ) { if ( ! pool ) return ERR_FAILURE ; if ( pool -> entries ) { size_t n = 0 ; for ( ; n < pool -> entries_total ; n ++ ) { sem_destroy ( & pool -> entries [ n ] . lock ) ; BP_MySQLClose ( pool -> entries [ n ] . conn ) ; } } BP_DestroyLinkL ( pool -> tq , BP_TRUE ) ; sem_destroy ( & pool -> lock ) ; bpfree ( pool ) ; return ERR_SUCCESS ; }
attempts to destroy a mysql connection pool
attempts to destroy a mysql connection pool
// ensure we have a pool // check to see if we have pool entries // walk each entry and destroy session // destroy the locks for each entry // close each session // destroy the entire tail queue (frees all dangling chunks) // destroy the semaphore // free the pool structure itself // return indicating success