#ifndef CS_HOLDER_H
#define CS_HOLDER_H

extern CRITICAL_SECTION IOSection;

struct cs_holder
{
	cs_holder(CRITICAL_SECTION & cs)
		: m_cs(cs)
	{
		EnterCriticalSection(&m_cs);
	}

	~cs_holder()
	{
		LeaveCriticalSection(&m_cs);
	}

	CRITICAL_SECTION & m_cs;
};

#endif
