3#include <Foundation/Basics.h>
4#include <Foundation/Threading/Implementation/ThreadingDeclarations.h>
14 PL_DISALLOW_COPY_AND_ASSIGN(
plMutex);
35 PL_ALWAYS_INLINE
bool IsLocked()
const {
return m_iLockCount > 0; }
37 plMutexHandle& GetMutexHandle() {
return m_hHandle; }
40 plMutexHandle m_hHandle;
41 plInt32 m_iLockCount = 0;
52 PL_ALWAYS_INLINE
void Lock() {}
60 PL_ALWAYS_INLINE
bool IsLocked()
const {
return false; }
63#if PL_ENABLED(PL_PLATFORM_WINDOWS)
64# include <Foundation/Threading/Implementation/Win/Mutex_win.h>
65#elif PL_ENABLED(PL_PLATFORM_OSX) || PL_ENABLED(PL_PLATFORM_LINUX) || PL_ENABLED(PL_PLATFORM_ANDROID)
66# include <Foundation/Threading/Implementation/Posix/Mutex_posix.h>
68# error "Mutex is not implemented on current platform"
Provides a simple mechanism for mutual exclusion to prevent multiple threads from accessing a shared ...
Definition Mutex.h:13
PL_ALWAYS_INLINE bool IsLocked() const
Returns true, if the mutex is currently acquired. Can be used to assert that a lock was entered.
Definition Mutex.h:35
A dummy mutex that does no locking.
Definition Mutex.h:49
PL_ALWAYS_INLINE void Lock()
Implements the 'Acquire' interface function, but does nothing.
Definition Mutex.h:52
PL_ALWAYS_INLINE plResult TryLock()
Implements the 'TryLock' interface function, but does nothing.
Definition Mutex.h:55
PL_ALWAYS_INLINE void Unlock()
Implements the 'Release' interface function, but does nothing.
Definition Mutex.h:58
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54