aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/mutex/abstract-mutex.h (renamed from backends/mutex/default/default-mutex.cpp)19
-rw-r--r--backends/mutex/null/null-mutex.h (renamed from backends/mutex/default/default-mutex.h)16
-rw-r--r--backends/mutex/sdl/sdl-mutex.h4
3 files changed, 23 insertions, 16 deletions
diff --git a/backends/mutex/default/default-mutex.cpp b/backends/mutex/abstract-mutex.h
index e10e9e8ade..b5e0263c09 100644
--- a/backends/mutex/default/default-mutex.cpp
+++ b/backends/mutex/abstract-mutex.h
@@ -23,8 +23,19 @@
*
*/
-#include "backends/mutex/default/default-mutex.h"
+#ifndef BACKENDS_MUTEX_ABSTRACT_H
+#define BACKENDS_MUTEX_ABSTRACT_H
-OSystem::MutexRef DefaultMutexManager::createMutex() {
- return OSystem::MutexRef();
-}
+#include "common/system.h"
+#include "common/noncopyable.h"
+
+class MutexManager : Common::NonCopyable {
+public:
+ virtual OSystem::MutexRef createMutex() = 0;
+ virtual void lockMutex(OSystem::MutexRef mutex) = 0;
+ virtual void unlockMutex(OSystem::MutexRef mutex) = 0;
+ virtual void deleteMutex(OSystem::MutexRef mutex) = 0;
+};
+
+
+#endif
diff --git a/backends/mutex/default/default-mutex.h b/backends/mutex/null/null-mutex.h
index 44aa8ee20f..76bb595631 100644
--- a/backends/mutex/default/default-mutex.h
+++ b/backends/mutex/null/null-mutex.h
@@ -23,21 +23,17 @@
*
*/
-#ifndef BACKENDS_MUTEX_DEFAULT_H
-#define BACKENDS_MUTEX_DEFAULT_H
+#ifndef BACKENDS_MUTEX_NULL_H
+#define BACKENDS_MUTEX_NULL_H
-#include "common/system.h"
-#include "common/noncopyable.h"
+#include "backends/mutex/abstract-mutex.h"
-class DefaultMutexManager : Common::NonCopyable {
+class NullMutexManager : MutexManager {
public:
- virtual ~DefaultMutexManager() {}
-
- OSystem::MutexRef createMutex();
+ OSystem::MutexRef createMutex() { return OSystem::MutexRef(); }
void lockMutex(OSystem::MutexRef mutex) {}
void unlockMutex(OSystem::MutexRef mutex) {}
- void deleteMutex(OSystem::MutexRef mutex);
+ void deleteMutex(OSystem::MutexRef mutex) {}
};
-
#endif
diff --git a/backends/mutex/sdl/sdl-mutex.h b/backends/mutex/sdl/sdl-mutex.h
index aad3032315..acd13a879d 100644
--- a/backends/mutex/sdl/sdl-mutex.h
+++ b/backends/mutex/sdl/sdl-mutex.h
@@ -26,9 +26,9 @@
#ifndef BACKENDS_MUTEX_SDL_H
#define BACKENDS_MUTEX_SDL_H
-#include "backends/mutex/default/default-mutex.h"
+#include "backends/mutex/abstract-mutex.h"
-class SdlMutexManager : public DefaultMutexManager {
+class SdlMutexManager : public MutexManager {
public:
OSystem::MutexRef createMutex();
void lockMutex(OSystem::MutexRef mutex);