include/AK/Tools/Win32/AkLock.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00010
00011 #ifndef _AKLOCK_H_
00012 #define _AKLOCK_H_
00013
00014 #include <AK/SoundEngine/Common/AkTypes.h>
00015 #include <windows.h>
00016
00017
00018
00019
00020 class CAkLock
00021 {
00022 public:
00024 CAkLock()
00025 {
00026 #ifdef AK_USE_METRO_API
00027 ::InitializeCriticalSectionEx( &m_csLock, 0, 0 );
00028 #else
00029 ::InitializeCriticalSection( &m_csLock );
00030 #endif
00031 }
00032
00034 ~CAkLock()
00035 {
00036 ::DeleteCriticalSection( &m_csLock );
00037 }
00038
00040 inline AKRESULT Lock( void )
00041 {
00042 ::EnterCriticalSection( &m_csLock );
00043 return AK_Success;
00044 }
00045
00047 inline AKRESULT Unlock( void )
00048 {
00049 ::LeaveCriticalSection( &m_csLock );
00050 return AK_Success;
00051 }
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 private:
00062 CRITICAL_SECTION m_csLock;
00063 };
00064
00065 #endif // _AKLOCK_H_
介绍一下自己的项目。我们会竭力为您提供帮助。
来注册自己的项目,我们帮您快速入门,不带任何附加条件!
开始 Wwise 之旅