mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-22 18:37:01 +00:00
Added mutex functions to MorphOS interface
svn-id: r4407
This commit is contained in:
parent
087ed25af5
commit
c7ceb99195
@ -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 )
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user