共用方式為


CComMultiThreadModelNoCS::AutoCriticalSection

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

typedef CComFakeCriticalSection AutoCriticalSection;

Remarks

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

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

Class defined in

Class referenced

CComMultiThreadModelNoCS

CComFakeCriticalSection

CComMultiThreadModel

CComAutoCriticalSection

CComSingleThreadModel

CComFakeCriticalSection

In addition to AutoCriticalSection, you can use the typedef name CriticalSection. 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

Reference

CComMultiThreadModelNoCS Class

CComObjectThreadModel

CComGlobalsThreadModel

CComMultiThreadModelNoCS::ThreadModelNoCS