diff options
| author | Lionel Ulmer | 2002-06-04 18:18:44 +0000 |
|---|---|---|
| committer | Lionel Ulmer | 2002-06-04 18:18:44 +0000 |
| commit | 31a2efd89cdae6f8722af77177dba2a7763a94a5 (patch) | |
| tree | 7aff5d5b39d746e20bd58de40e2857bce59d7788 /sdl.cpp | |
| parent | 08cdef16191c9ea6cdf8611a24d74748533be6d4 (diff) | |
| download | scummvm-rg350-31a2efd89cdae6f8722af77177dba2a7763a94a5.tar.gz scummvm-rg350-31a2efd89cdae6f8722af77177dba2a7763a94a5.tar.bz2 scummvm-rg350-31a2efd89cdae6f8722af77177dba2a7763a94a5.zip | |
Sorry for the mess.... Here is the mutex code :-)
svn-id: r4403
Diffstat (limited to 'sdl.cpp')
| -rw-r--r-- | sdl.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -99,6 +99,12 @@ public: // Add a callback timer void set_timer(int timer, int (*callback)(int)); + // Mutex handling + void *create_mutex(void); + void lock_mutex(void *mutex); + void unlock_mutex(void *mutex); + void delete_mutex(void *mutex); + static OSystem *create(int gfx_mode, bool full_screen); private: @@ -1148,6 +1154,23 @@ void OSystem_SDL::setup_icon() { SDL_WM_SetIcon(sdl_surf, (unsigned char *) mask); } +void *OSystem_SDL::create_mutex(void) { + return (void *) SDL_CreateMutex(); +} + +void OSystem_SDL::lock_mutex(void *mutex) { + SDL_mutexP((SDL_mutex *) mutex); +} + +void OSystem_SDL::unlock_mutex(void *mutex) { + SDL_mutexV((SDL_mutex *) mutex); +} + +void OSystem_SDL::delete_mutex(void *mutex) { + SDL_DestroyMutex((SDL_mutex *) mutex); +} + + #ifdef USE_NULL_DRIVER /* NULL video driver */ |
