Core/LockGuard: Improve LockGuard

Former-commit-id: e9313d81c8cd9cb2cefef64a7c54713062ad9d6a
This commit is contained in:
Lynix
2016-04-16 18:38:52 +02:00
parent 1ec8c8c5e0
commit 104e393d65
3 changed files with 93 additions and 40 deletions

View File

@@ -13,15 +13,22 @@ namespace Nz
{
class Mutex;
class NAZARA_CORE_API LockGuard
class LockGuard
{
public:
LockGuard(Mutex& mutex);
~LockGuard();
inline LockGuard(Mutex& mutex, bool lock = true);
inline ~LockGuard();
inline void Lock();
inline bool TryLock();
inline void Unlock();
private:
Mutex& m_mutex;
bool m_locked;
};
}
#include <Nazara/Core/LockGuard.inl>
#endif // NAZARA_LOCKGUARD_HPP