CComAutoCriticalSection クラス

CComAutoCriticalSection は、クリティカル セクション オブジェクトの所有権を取得および解放するためのメソッドを提供します。

構文

class CComAutoCriticalSection : public CComCriticalSection

メンバー

パブリック コンストラクター

名前 説明
CComAutoCriticalSection::CComAutoCriticalSection コンストラクター。
CComAutoCriticalSection::~CComAutoCriticalSection デストラクター。

解説

CComAutoCriticalSectionCComCriticalSection クラスに似ていますが、CComAutoCriticalSection の場合、コンストラクターでクリティカル セクション オブジェクトが自動的に初期化される点が異なります。

通常は、typedef によって AutoCriticalSection という名前を付けて CComAutoCriticalSection を使用します。 CComMultiThreadModel が使用されている場合、この名前は CComAutoCriticalSection を参照します。

このクラスを使用する場合、CComCriticalSectionInitTerm メソッドは使用できません。

継承階層

CComCriticalSection

CComAutoCriticalSection

必要条件

ヘッダー: atlcore.h

CComAutoCriticalSection::CComAutoCriticalSection

コンストラクター。

CComAutoCriticalSection();

解説

クリティカル セクション オブジェクトを初期化する Win32 関数 InitializeCriticalSection を呼び出します。

CComAutoCriticalSection::~CComAutoCriticalSection

デストラクター。

~CComAutoCriticalSection() throw();

解説

このデストラクターは DeleteCriticalSection を呼び出します。これにより、クリティカル セクション オブジェクトによって使用されるすべてのシステム リソースが解放されます。

関連項目

CComFakeCriticalSection クラス
クラスの概要
CComCriticalSection クラス