⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 threadmanager.cpp

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 CPP
字号:
//--------------------------------------------------------------------------------// // Filename    : ThreadManager.cc// Written By  : Reiot// //--------------------------------------------------------------------------------// include files#include "ThreadManager.h"#include "ThreadPool.h"#include "ZoneGroupThread.h"#include "Assert.h"#include "LogClient.h"#include "ZoneGroupManager.h"#include "Properties.h"#include "DB.h"//--------------------------------------------------------------------------------// constructor//--------------------------------------------------------------------------------ThreadManager::ThreadManager ()      throw (Error): m_pZoneGroupThreadPool(NULL){	__BEGIN_TRY			// 粮静饭靛钱阑 积己茄促.	m_pZoneGroupThreadPool = new ThreadPool();	__END_CATCH}	//--------------------------------------------------------------------------------//// destructor//// Stop()捞 登瘤 臼疽阑 版快 角青矫难具 茄促. State 俺充阑 档涝且鳖?////--------------------------------------------------------------------------------ThreadManager::~ThreadManager ()      throw (Error){	__BEGIN_TRY	SAFE_DELETE(m_pZoneGroupThreadPool);	__END_CATCH}//--------------------------------------------------------------------------------//// 静饭靛 概聪历甫 檬扁拳茄促.//// 窍困 静饭靛钱俊 静饭靛甸阑 积己, 殿废矫挪促.//// *CAUTION*//// 寸楷洒, 静饭靛 概聪历甫 檬扁拳窍扁 傈俊, 粮弊缝概聪历甫 檬扁拳秦具 茄促.////--------------------------------------------------------------------------------void ThreadManager::init ()      throw (Error){	__BEGIN_TRY			// 粮 静饭靛甫 殿废茄促.	Statement* pStmt   = NULL;	Result*    pResult = NULL;	BEGIN_DB	{		pStmt   = g_pDatabaseManager->getConnection("DARKEDEN")->createStatement();		pResult = pStmt->executeQuery("SELECT ZoneGroupID FROM ZoneGroupInfo");		while (pResult->next()) 		{			ZoneGroupID_t zoneGroupID = pResult->getInt(1);			ZoneGroupThread* pZoneGroupThread = new ZoneGroupThread(g_pZoneGroupManager->getZoneGroup(zoneGroupID));			m_pZoneGroupThreadPool->addThread(pZoneGroupThread);		}		SAFE_DELETE(pStmt);	} 	END_DB(pStmt)	__END_CATCH}	//--------------------------------------------------------------------------------//// activate sub thread pools//// 窍困 静饭靛 钱阑 劝己拳矫挪促. ////--------------------------------------------------------------------------------void ThreadManager::start ()      throw (Error){	__BEGIN_TRY	// Zone Thread Pool 阑 劝己拳矫挪促.	m_pZoneGroupThreadPool->start();		__END_CATCH}	//--------------------------------------------------------------------------------//// deactivate sub thread pools//// 窍困 静饭靛 钱阑 辆丰矫挪促.////--------------------------------------------------------------------------------void ThreadManager::stop ()      throw (Error){	__BEGIN_TRY	throw UnsupportedError();	__END_CATCH}//--------------------------------------------------------------------------------// global variable definition//--------------------------------------------------------------------------------ThreadManager* g_pThreadManager = NULL;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -