CComAutoCriticalSection Class

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see CComAutoCriticalSection Class on docs.microsoft.com. CComAutoCriticalSection provides methods for obtaining and releasing ownership of a critical section object.

class CComAutoCriticalSection : public CComCriticalSection

Public Constructors

NameDescription
CComAutoCriticalSection::CComAutoCriticalSectionThe constructor.
CComAutoCriticalSection::~CComAutoCriticalSectionThe destructor.

CComAutoCriticalSection is similar to class CComCriticalSection, except CComAutoCriticalSection automatically initializes the critical section object in the constructor.

Typically, you use CComAutoCriticalSection through the typedef name AutoCriticalSection. This name references CComAutoCriticalSection when CComMultiThreadModel is being used.

The Init and Term methods from CComCriticalSection are not available when using this class.

CComCriticalSection

CComAutoCriticalSection

Header: atlcore.h

The constructor.

CComAutoCriticalSection();

Remarks

Calls the Win32 function InitializeCriticalSection, which initializes the critical section object.

The destructor.

~CComAutoCriticalSection() throw();

Remarks

The destructor calls DeleteCriticalSection, which releases all system resources used by the critical section object.

CComFakeCriticalSection Class
Class Overview
CComCriticalSection Class

Show: