Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
61
Server/RylServerProject/BaseLibrary/Thread/ThreadMgr.h
Normal file
61
Server/RylServerProject/BaseLibrary/Thread/ThreadMgr.h
Normal file
@@ -0,0 +1,61 @@
|
||||
#ifndef _CTHREADMGR_H_
|
||||
#define _CTHREADMGR_H_
|
||||
|
||||
#ifndef WINDOWS_LEAN_AND_MEAN
|
||||
#define WINDOWS_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#include "Lock.h"
|
||||
|
||||
// forward decl
|
||||
class CThread;
|
||||
|
||||
class CThreadMgr
|
||||
{
|
||||
public:
|
||||
|
||||
enum { MAX_THREAD_NUM = 63 };
|
||||
|
||||
CThreadMgr();
|
||||
virtual ~CThreadMgr();
|
||||
|
||||
bool RegisterAndRun(CThread* lpThread); // <20><><EFBFBD><EFBFBD><EFBFBD>带 <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>. <20>ִ<EFBFBD> 63<36><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ִ<EFBFBD>.
|
||||
bool JoinThread(); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>带 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2>.
|
||||
|
||||
inline int GetNum()
|
||||
{
|
||||
return m_nThreadNum;
|
||||
}
|
||||
inline int GetMaxNum()
|
||||
{
|
||||
return MAX_THREAD_NUM;
|
||||
}
|
||||
|
||||
CThread* GetThread(int iPos)
|
||||
{
|
||||
return m_lpThreads[iPos];
|
||||
}
|
||||
|
||||
|
||||
// <20>Ŵ<EFBFBD><C5B4><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʰ<EFBFBD>, <20>׳<EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ų<EFBFBD><C5B2>.
|
||||
static HANDLE Run(CThread* lpThread);
|
||||
static bool Stop(CThread* lpThread, unsigned long dwTimeout = INFINITE);
|
||||
|
||||
private:
|
||||
|
||||
typedef CCSLock ThreadLock;
|
||||
|
||||
CThread* m_lpThreads[MAX_THREAD_NUM];
|
||||
HANDLE m_hThreads[MAX_THREAD_NUM];
|
||||
|
||||
ThreadLock m_ThreadLock;
|
||||
|
||||
unsigned int m_nThreadNum;
|
||||
unsigned int m_bJoinStarted;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user