aboutsummaryrefslogtreecommitdiff
path: root/backends/mutex
diff options
context:
space:
mode:
Diffstat (limited to 'backends/mutex')
-rw-r--r--backends/mutex/mutex.h5
-rw-r--r--backends/mutex/null/null-mutex.h11
-rw-r--r--backends/mutex/sdl/sdl-mutex.h11
3 files changed, 18 insertions, 9 deletions
diff --git a/backends/mutex/mutex.h b/backends/mutex/mutex.h
index d8647bae13..ddf27d5932 100644
--- a/backends/mutex/mutex.h
+++ b/backends/mutex/mutex.h
@@ -29,6 +29,10 @@
#include "common/system.h"
#include "common/noncopyable.h"
+/**
+ * Abstract class for mutex manager. Subclasses
+ * implement the real functionality.
+ */
class MutexManager : Common::NonCopyable {
public:
virtual ~MutexManager() {}
@@ -39,5 +43,4 @@ public:
virtual void deleteMutex(OSystem::MutexRef mutex) = 0;
};
-
#endif
diff --git a/backends/mutex/null/null-mutex.h b/backends/mutex/null/null-mutex.h
index ddfe23bdee..54b8f5ce96 100644
--- a/backends/mutex/null/null-mutex.h
+++ b/backends/mutex/null/null-mutex.h
@@ -28,12 +28,15 @@
#include "backends/mutex/mutex.h"
+/**
+ * Null mutex manager
+ */
class NullMutexManager : MutexManager {
public:
- OSystem::MutexRef createMutex() { return OSystem::MutexRef(); }
- void lockMutex(OSystem::MutexRef mutex) {}
- void unlockMutex(OSystem::MutexRef mutex) {}
- void deleteMutex(OSystem::MutexRef mutex) {}
+ virtual OSystem::MutexRef createMutex() { return OSystem::MutexRef(); }
+ virtual void lockMutex(OSystem::MutexRef mutex) {}
+ virtual void unlockMutex(OSystem::MutexRef mutex) {}
+ virtual void deleteMutex(OSystem::MutexRef mutex) {}
};
#endif
diff --git a/backends/mutex/sdl/sdl-mutex.h b/backends/mutex/sdl/sdl-mutex.h
index a929ea495f..88a19d398a 100644
--- a/backends/mutex/sdl/sdl-mutex.h
+++ b/backends/mutex/sdl/sdl-mutex.h
@@ -28,12 +28,15 @@
#include "backends/mutex/mutex.h"
+/**
+ * SDL mutex manager
+ */
class SdlMutexManager : public MutexManager {
public:
- OSystem::MutexRef createMutex();
- void lockMutex(OSystem::MutexRef mutex);
- void unlockMutex(OSystem::MutexRef mutex);
- void deleteMutex(OSystem::MutexRef mutex);
+ virtual OSystem::MutexRef createMutex();
+ virtual void lockMutex(OSystem::MutexRef mutex);
+ virtual void unlockMutex(OSystem::MutexRef mutex);
+ virtual void deleteMutex(OSystem::MutexRef mutex);
};