From fda9416cc8b64fa7371b7a9989def9cc318efc7e Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Sat, 3 Jul 2010 00:13:45 +0000 Subject: Cleanup and documentation. svn-id: r50609 --- backends/mutex/mutex.h | 5 ++++- backends/mutex/null/null-mutex.h | 11 +++++++---- backends/mutex/sdl/sdl-mutex.h | 11 +++++++---- 3 files changed, 18 insertions(+), 9 deletions(-) (limited to 'backends/mutex') 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); }; -- cgit v1.2.3