summaryrefslogtreecommitdiff
path: root/src/utils/mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/mutex.h')
-rw-r--r--src/utils/mutex.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/utils/mutex.h b/src/utils/mutex.h
index 6c35987c..62c6b4e1 100644
--- a/src/utils/mutex.h
+++ b/src/utils/mutex.h
@@ -40,6 +40,9 @@ public:
void unlock();
private:
+ Mutex(const Mutex&); // prevent copying
+ Mutex& operator=(const Mutex&);
+
SDL_mutex *mMutex;
};
@@ -49,11 +52,11 @@ private:
class MutexLocker
{
public:
- MutexLocker(Mutex mutex);
+ MutexLocker(Mutex *mutex);
~MutexLocker();
private:
- Mutex mMutex;
+ Mutex *mMutex;
};
@@ -80,15 +83,15 @@ inline void Mutex::unlock()
}
-inline MutexLocker::MutexLocker(Mutex mutex):
+inline MutexLocker::MutexLocker(Mutex *mutex):
mMutex(mutex)
{
- mMutex.lock();
+ mMutex->lock();
}
inline MutexLocker::~MutexLocker()
{
- mMutex.unlock();
+ mMutex->unlock();
}
#endif // TMW_MUTEX_H