aboutsummaryrefslogtreecommitdiff
path: root/backends/sdl/sdl-common.h
diff options
context:
space:
mode:
authorMax Horn2003-07-05 15:17:46 +0000
committerMax Horn2003-07-05 15:17:46 +0000
commit4611b12c0a84ec528f9f020dc85bf4e9a0108c82 (patch)
tree8a7f87ffbad997a6873a1a6e75d0d49746e9d69e /backends/sdl/sdl-common.h
parent39abb7cf0a36f348c2755197e18ae2d9edc59eda (diff)
downloadscummvm-rg350-4611b12c0a84ec528f9f020dc85bf4e9a0108c82.tar.gz
scummvm-rg350-4611b12c0a84ec528f9f020dc85bf4e9a0108c82.tar.bz2
scummvm-rg350-4611b12c0a84ec528f9f020dc85bf4e9a0108c82.zip
updated backends to use type MutexRef
svn-id: r8776
Diffstat (limited to 'backends/sdl/sdl-common.h')
-rw-r--r--backends/sdl/sdl-common.h21
1 files changed, 5 insertions, 16 deletions
diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h
index da878153d4..4a2a8d0087 100644
--- a/backends/sdl/sdl-common.h
+++ b/backends/sdl/sdl-common.h
@@ -105,10 +105,10 @@ public:
void set_timer(int timer, int (*callback)(int));
// Mutex handling
- void *create_mutex();
- void lock_mutex(void *mutex);
- void unlock_mutex(void *mutex);
- void delete_mutex(void *mutex);
+ MutexRef create_mutex();
+ void lock_mutex(MutexRef mutex);
+ void unlock_mutex(MutexRef mutex);
+ void delete_mutex(MutexRef mutex);
// Overlay
virtual void show_overlay();
@@ -208,7 +208,7 @@ protected:
// Mutex that prevents multiple threads interferring with each other
// when accessing the screen.
- SDL_mutex *_graphicsMutex;
+ MutexRef _graphicsMutex;
void add_dirty_rgn_auto(const byte *buf);
@@ -229,15 +229,4 @@ protected:
void init_joystick() { _joystick = SDL_JoystickOpen(0); }
};
-// Auxillary class to (un)lock a mutex on the stack
-class StackLock {
- SDL_mutex *_mutex;
-public:
- StackLock(SDL_mutex *mutex) : _mutex(mutex) { lock(); }
- ~StackLock() { unlock(); }
- void lock() { SDL_mutexP(_mutex); }
- void unlock() { SDL_mutexV(_mutex); }
-};
-
-
#endif