windows-nt/Source/XPSP1/NT/printscan/print/spooler/spllib/csem.hxx

53 lines
962 B
C++
Raw Normal View History

2020-09-26 03:20:57 -05:00
#ifndef _CSEM_H
#define _CSEM_H
/*****************************************************************************\
* Class CriticalSection - Header file
*
* Copyright (C) 1998 Microsoft Corporation
*
* History:
* Jun 10, 1998, Weihai Chen (weihaic)
*
\*****************************************************************************/
class CCriticalSection
{
public:
CCriticalSection (void);
virtual
~CCriticalSection (void);
inline BOOL
bValid () CONST { return m_bValid;};
BOOL
Lock (void) const;
BOOL
Unlock (void) const;
private:
CRITICAL_SECTION m_csec;
BOOL m_bValid;
};
typedef class CCriticalSection TCriticalSection;
class TAutoCriticalSection
{
public:
TAutoCriticalSection (
CONST TCriticalSection & refCrit);
~TAutoCriticalSection (VOID);
BOOL bValid (VOID);
private:
BOOL m_bValid;
const TCriticalSection &m_pCritSec;
};
#endif