Panda3D
|
00001 // Filename: mutexWin32Impl.h 00002 // Created by: drose (07Feb06) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef MUTEXWIN32IMPL_H 00016 #define MUTEXWIN32IMPL_H 00017 00018 #include "dtoolbase.h" 00019 #include "selectThreadImpl.h" 00020 00021 #ifdef WIN32_VC 00022 #define WIN32_LEAN_AND_MEAN 00023 #include <windows.h> 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Class : MutexWin32Impl 00027 // Description : Uses Windows native calls to implement a mutex. 00028 //////////////////////////////////////////////////////////////////// 00029 class EXPCL_DTOOL MutexWin32Impl { 00030 public: 00031 MutexWin32Impl(); 00032 INLINE ~MutexWin32Impl(); 00033 00034 INLINE void acquire(); 00035 INLINE bool try_acquire(); 00036 INLINE void release(); 00037 00038 private: 00039 CRITICAL_SECTION _lock; 00040 friend class ConditionVarWin32Impl; 00041 friend class ConditionVarFullWin32Impl; 00042 }; 00043 00044 #include "mutexWin32Impl.I" 00045 00046 #endif // WIN32_VC 00047 00048 #endif