library/src/blockclass/BP-BlockClass.cc
// closes an established mysql connection (local class or a pointer)
closes an established mysql connection (local class or a pointer)
closes an established mysql connection ( local class or a pointer )
BP_ERROR_T Block::MysqlClose(P_BP_MYSQL_SESSION mysqlSession)
{
	BP_BLOCK_MARIADB_ENTER_CRITICAL_SECTION;
	BP_ERROR_T ret_val = ERR_FAILURE;
	if(mysqlSession)
	{
		ret_val = BP_MySQLClose(mysqlSession);
		this->mysqlSession = NULL;
		BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION;
		return ret_val;
	}
	BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION;
	ret_val = BP_MySQLClose(this->mysqlSession);
	this->mysqlSession = NULL;
	return ret_val;
}
BP_ERROR_T Block :: MysqlClose ( P_BP_MYSQL_SESSION mysqlSession ) { BP_BLOCK_MARIADB_ENTER_CRITICAL_SECTION ; BP_ERROR_T ret_val = ERR_FAILURE ; if ( mysqlSession ) { ret_val = BP_MySQLClose ( mysqlSession ) ; this -> mysqlSession = NULL ; BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION ; return ret_val ; } BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION ; ret_val = BP_MySQLClose ( this -> mysqlSession ) ; this -> mysqlSession = NULL ; return ret_val ; }
closes an established mysql connection (local class or a pointer)
closes an established mysql connection ( local class or a pointer )
// enter critical section // var for return value // ensure we have a session to close // close the session // set handle to null // return the close return value // return the out value // attempt close (destorys session and autolocks the critical section) // set mysql session to null // return the provided value