Freigeben über


CComMultiThreadModel::CriticalSection

When using CComMultiThreadModel, the typedef name CriticalSection references class CComCriticalSection, which provides methods for obtaining and releasing ownership of a critical section object.

typedef CComCriticalSection CriticalSection;

Remarks

CComSingleThreadModel and CComMultiThreadModelNoCS also contain definitions for CriticalSection. The following table shows the relationship between the threading model class and the critical section class referenced by CriticalSection:

Class defined in

Class referenced

CComMultiThreadModel

CComCriticalSection

CComSingleThreadModel

CComFakeCriticalSection

CComMultiThreadModelNoCS

CComFakeCriticalSection

In addition to CriticalSection, you can use the typedef name AutoCriticalSection. You should not specify AutoCriticalSection in global objects or static class members if you want to eliminate the CRT startup code.

Example

See CComMultiThreadModel::AutoCriticalSection.

Requirements

Header: atlbase.h

See Also

Concepts

CComMultiThreadModel Class

CComMultiThreadModel Members

CComObjectThreadModel

CComGlobalsThreadModel

CComMultiThreadModel::ThreadModelNoCS