diff options
author | Ruediger Hanke | 2002-06-05 13:48:32 +0000 |
---|---|---|
committer | Ruediger Hanke | 2002-06-05 13:48:32 +0000 |
commit | c7ceb99195e88b0facd11cb1a9844c6604090538 (patch) | |
tree | e93b892947e48db50a789f7db1f5f41bbd1ea2cf | |
parent | 087ed25af5da6501d5041302488b1a84a77ae3aa (diff) | |
download | scummvm-rg350-c7ceb99195e88b0facd11cb1a9844c6604090538.tar.gz scummvm-rg350-c7ceb99195e88b0facd11cb1a9844c6604090538.tar.bz2 scummvm-rg350-c7ceb99195e88b0facd11cb1a9844c6604090538.zip |
Added mutex functions to MorphOS interface
svn-id: r4407
-rw-r--r-- | morphos/morphos.cpp | 25 | ||||
-rw-r--r-- | morphos/morphos.h | 6 |
2 files changed, 31 insertions, 0 deletions
diff --git a/morphos/morphos.cpp b/morphos/morphos.cpp index 6009de7dbc..1b08b0c715 100644 --- a/morphos/morphos.cpp +++ b/morphos/morphos.cpp @@ -277,6 +277,31 @@ void *OSystem_MorphOS::create_thread(ThreadProc *proc, void *param) return ScummMusicThread; } +void *OSystem_MorphOS::create_mutex(void) +{ + struct SignalSemaphore *sem = (struct SignalSemaphore *)AllocVec( sizeof( struct SignalSemaphore ), MEMF_PUBLIC ); + + if( sem ) + InitSemaphore( sem ); + + return sem; +} + +void OSystem_MorphOS::lock_mutex(void *mutex) +{ + ObtainSemaphore( (struct SignalSemaphore *)mutex ); +} + +void OSystem_MorphOS::unlock_mutex(void *mutex) +{ + ReleaseSemaphore( (struct SignalSemaphore *)mutex ); +} + +void OSystem_MorphOS::delete_mutex(void *mutex) +{ + FreeVec( mutex ); +} + uint32 OSystem_MorphOS::property(int param, Property *value) { switch( param ) diff --git a/morphos/morphos.h b/morphos/morphos.h index d0be723318..752a007179 100644 --- a/morphos/morphos.h +++ b/morphos/morphos.h @@ -67,6 +67,12 @@ class OSystem_MorphOS : public OSystem // Add a new callback timer virtual void set_timer(int timer, int (*callback)(int)); + // Mutex handling + virtual void *create_mutex(void); + virtual void lock_mutex(void *mutex); + virtual void unlock_mutex(void *mutex); + virtual void delete_mutex(void *mutex); + // Create a thread virtual void *create_thread(ThreadProc *proc, void *param); |