Add logger.h and locker.h

This commit is contained in:
yuanyuanxiang
2025-05-09 03:09:25 +08:00
parent a21706f350
commit 82e09d945d
5 changed files with 379 additions and 176 deletions

View File

@@ -373,47 +373,6 @@ public:
typedef IOCPServer ISocketBase;
class CLock
{
public:
CLock(CRITICAL_SECTION& cs) : m_cs(&cs)
{
Lock();
}
CLock() : m_cs(nullptr)
{
InitializeCriticalSection(&i_cs);
}
~CLock()
{
m_cs ? Unlock() : DeleteCriticalSection(&i_cs);
}
void Unlock()
{
LeaveCriticalSection(m_cs ? m_cs : &i_cs);
}
void Lock()
{
EnterCriticalSection(m_cs ? m_cs : &i_cs);
}
void unlock()
{
LeaveCriticalSection(m_cs ? m_cs : &i_cs);
}
void lock()
{
EnterCriticalSection(m_cs ? m_cs : &i_cs);
}
protected:
CRITICAL_SECTION* m_cs; // <20>ⲿ<EFBFBD><E2B2BF>
CRITICAL_SECTION i_cs; // <20>ڲ<EFBFBD><DAB2><EFBFBD>
};
#define TRACK_OVERLAPPEDPLUS 0
class OVERLAPPEDPLUS