Partager via


CComMultiThreadModelNoCS::CriticalSection

When using CComMultiThreadModelNoCS, the typedef name CriticalSection references class CComFakeCriticalSection.

typedef CComFakeCriticalSection CriticalSection;

Remarks

Because CComFakeCriticalSection does not provide a critical section, its methods do nothing.

CComMultiThreadModel and CComSingleThreadModel 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

CComMultiThreadModelNoCS

CComFakeCriticalSection

CComMultiThreadModel

CComCriticalSection

CComSingleThreadModel

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

CComMultiThreadModelNoCS Class

CComMultiThreadModelNoCS Members

CComObjectThreadModel

CComGlobalsThreadModel

CComMultiThreadModelNoCS::ThreadModelNoCS