#ifndef _RUTHREAD_CRITICALSECTION_
#define _RUTHREAD_CRITICALSECTION_

// Base types
#include "../../Core/Type/RuType_Base.h"

#pragma unmanaged

// ************************************************************************************************************************************************************

class CRuThread_CriticalSection
{
protected:
	CRITICAL_SECTION								m_criticalSection;

public:
													CRuThread_CriticalSection();
	virtual											~CRuThread_CriticalSection();

	void											Enter();
	BOOL											TryEnter();
	void											Leave();

protected:
	// Prevent copying by declaring copy constructors as protected
													CRuThread_CriticalSection(const CRuThread_CriticalSection &obj);
	CRuThread_CriticalSection&						operator=(const CRuThread_CriticalSection & obj);
};

// ************************************************************************************************************************************************************

#pragma managed

#endif
