summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-05 22:26:38 +0100
committerIra Rice <irarice@gmail.com>2008-12-05 15:55:31 -0700
commit032f7659014d265a3c34765da2f277b7b0f32691 (patch)
tree2ac9b405c6d820dab72b8c5810127cf0cf46e25d /src/utils
parent7d5bfc11b5e467b502a3b56e853200b887859808 (diff)
downloadmana-client-032f7659014d265a3c34765da2f277b7b0f32691.tar.gz
mana-client-032f7659014d265a3c34765da2f277b7b0f32691.tar.bz2
mana-client-032f7659014d265a3c34765da2f277b7b0f32691.tar.xz
mana-client-032f7659014d265a3c34765da2f277b7b0f32691.zip
Fixed MutexLocker to not work on a copy
The Mutex class wasn't meant to be copied around. Silly last minute refactorings leading to untested code...
Diffstat (limited to 'src/utils')
-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