windows-nt/Source/XPSP1/NT/enduser/stuff/itircl/orkin/critsec.h

25 lines
463 B
C
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
#ifndef __CRITSEC_H__
#define __CRITSEC_H__
//
// CRITSEC.H: Wrapper class for critical sections
//
//
class CCriticalSection
{
public:
// Constructor/Destructor
CCriticalSection() { InitializeCriticalSection(&m_CriticalSection); }
~CCriticalSection() { DeleteCriticalSection(&m_CriticalSection); }
protected:
CRITICAL_SECTION m_CriticalSection;
public:
inline operator CRITICAL_SECTION*() { return &m_CriticalSection; }
};
#endif