📄 warthreadengine.cpp
字号:
#include "StdAfx.h"#include "WarThreadEngine.h" // class implemented#ifndef WAR_AUTO_LOCK_H# include "WarAutoLock.h"#endif#define AUTO_LOCK WarAutoLock my_lock(mLock)/////////////////////////////// PUBLIC ///////////////////////////////////////WarThreadEngine *WarThreadEngine::mspThis;//============================= LIFECYCLE ====================================WarThreadEngine::WarThreadEngine(){ if (NULL == mspThis) mspThis = this;}// WarThreadEngineWarThreadEngine::~WarThreadEngine(){ if (this == mspThis) mspThis = NULL;}// ~WarThreadEngine//============================= OPERATORS ====================================//============================= OPERATIONS ===================================void WarThreadEngine::SetPriOnAllThreads(const WarPrioritiesDefE newPriority){ AUTO_LOCK; for(thread_set_t::iterator P = mThreads.begin() ; P != mThreads.end() ; ++P) { (*P)->SetPriority(newPriority); }}//============================= CALLBACK ===================================//============================= ACCESS ===================================//============================= INQUIRY ===================================/////////////////////////////// PROTECTED ///////////////////////////////////void WarThreadEngine::AddThread(WarThread *pThread){ AUTO_LOCK; mThreads.insert(war_thread_ptr_t(pThread));}void WarThreadEngine::RemoveThread(WarThread *pThread){ AUTO_LOCK; thread_set_t::iterator P = mThreads.find(war_thread_ptr_t(pThread)); if (P != mThreads.end()) mThreads.erase(P);}/////////////////////////////// PRIVATE ///////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -