Improvement: Prepare for optimization of online capacity

This commit is contained in:
yuanyuanxiang
2025-04-07 18:18:36 +08:00
parent 69afaf19c0
commit 72459de00e
26 changed files with 931 additions and 231 deletions

View File

@@ -99,3 +99,28 @@ public:
#ifndef SAFE_DELETE_ARRAY
#define SAFE_DELETE_ARRAY(p) if(NULL !=(p)){ delete[] (p);(p) = NULL;}
#endif
class CLock
{
private:
CRITICAL_SECTION m_cs;
public:
CLock()
{
InitializeCriticalSection(&m_cs);
}
~CLock()
{
DeleteCriticalSection(&m_cs);
}
void Unlock()
{
LeaveCriticalSection(&m_cs);
}
void Lock()
{
EnterCriticalSection(&m_cs);
}
};