#pragma once
#include <windows.h>
class TCriticalSection
{
private:
CRITICAL_SECTION m_critical;
TCriticalSection()
{
InitializeCriticalSection(&m_critical);
};
~TCriticalSection()
{
DeleteCriticalSection(&m_critical);
};
public:
void Lock()
{
EnterCriticalSection(&m_critical);
};
void UnLock()
{
LeaveCriticalSection(&m_critical);
}
};