library/src/blockclass/subclasses/BP_MySQLMultiThreadConnectionPool.cc
// class deconstructor (automatically cleans up class)
class deconstructor (automatically cleans up class)
class deconstructor ( automatically cleans up class )
BP_MySQLMultiThreadConnectionPool::~BP_MySQLMultiThreadConnectionPool()
{
	size_t n = 0;
	for(; n < this->conn_n; n++)
	{
		TryLockMutex(this->conns[n].mutex);
		UnlockMutex(this->conns[n].mutex);
		DestroyMutex(this->conns[n].mutex, BP_TRUE);
		if(this->conns[n].mysqli)
			delete this->conns[n].mysqli;
	}
	TryLockMutex(this->mutex);
	UnlockMutex(this->mutex);
	DestroyMutex(this->mutex, BP_TRUE);
	if(this->gc)
	{
		BP_GarbageCollectorFreeAllChunks(this->gc);
		BP_DestroyGarbageCollector(this->gc);
		this->gc = NULL;
	}
}
BP_MySQLMultiThreadConnectionPool :: ~ BP_MySQLMultiThreadConnectionPool ( ) { size_t n = 0 ; for ( ; n < this -> conn_n ; n ++ ) { TryLockMutex ( this -> conns [ n ] . mutex ) ; UnlockMutex ( this -> conns [ n ] . mutex ) ; DestroyMutex ( this -> conns [ n ] . mutex , BP_TRUE ) ; if ( this -> conns [ n ] . mysqli ) delete this -> conns [ n ] . mysqli ; } TryLockMutex ( this -> mutex ) ; UnlockMutex ( this -> mutex ) ; DestroyMutex ( this -> mutex , BP_TRUE ) ; if ( this -> gc ) { BP_GarbageCollectorFreeAllChunks ( this -> gc ) ; BP_DestroyGarbageCollector ( this -> gc ) ; this -> gc = NULL ; } }
class deconstructor (automatically cleans up class)
class deconstructor ( automatically cleans up class )
// walk all connections // try to unlock the connection mutex // destroy the connection block // unlock the class mutex itself // destroy allocated chunks