メインページ | ネームスペース一覧 | クラス階層 | 構成 | Directories | ファイル一覧 | ネームスペースメンバ | 構成メンバ | ファイルメンバ | 関連ページ

WBCriticalSection.h

00001 #ifndef WINCMP_MISC_CCRITICALSECTION_H
00002 #define WINCMP_MISC_CCRITICALSECTION_H
00003 #if _MSC_VER >= 1000
00004 #pragma once
00005 #endif // _MSC_VER >= 1000
00006 
00007 #include <Base/BaseDebug.h>
00008 #include <vector>
00009 namespace Spr {
00010 
00011 class SPR_DLL WBCriticalSection{
00012     CRITICAL_SECTION cr;
00013 public:
00014     WBCriticalSection(){
00015         InitializeCriticalSection(&cr);
00016     }
00017     ~WBCriticalSection(){
00018         DeleteCriticalSection(&cr);
00019     }
00020     void Enter(){
00021         EnterCriticalSection(&cr);
00022     }
00023     void Leave(){
00024         LeaveCriticalSection(&cr);
00025     }
00026 };
00027 
00028 struct WBAutoLock{
00029     WBCriticalSection& cr;
00030     WBAutoLock(WBCriticalSection& c):cr(c){
00031         cr.Enter();
00032     }
00033     ~WBAutoLock(){
00034         cr.Leave();
00035     }
00036 };
00037 
00038 }   //  namespace Spr
00039 
00040 #endif

Springheadに対してSun Apr 16 01:57:58 2006に生成されました。  doxygen 1.4.1