From eb537c560a33db9955413a96afd3b98203a729fe Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 20 May 2014 23:23:58 -0400 Subject: mutex: refactored the interface to code to return a Mutex* handle --- src/core/hle/kernel/mutex.cpp | 14 ++++++++++++-- src/core/hle/kernel/mutex.h | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/core/hle/kernel') diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index 2b2cff4ea..7cf3439e9 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp @@ -102,7 +102,7 @@ Result ReleaseMutex(Handle handle) { * @param handle Reference to handle for the newly created mutex * @param initial_locked Specifies if the mutex should be locked initially */ -Result CreateMutex(Handle& handle, bool initial_locked) { +Mutex* CreateMutex(Handle& handle, bool initial_locked) { Mutex* mutex = new Mutex; handle = Kernel::g_object_pool.Create(mutex); @@ -116,7 +116,17 @@ Result CreateMutex(Handle& handle, bool initial_locked) { } else { mutex->lock_thread = -1; } - return 0; + return mutex; +} + +/** + * Creates a mutex + * @param initial_locked Specifies if the mutex should be locked initially + */ +Handle CreateMutex(bool initial_locked) { + Handle handle; + Mutex* mutex = CreateMutex(handle, initial_locked); + return handle; } } // namespace diff --git a/src/core/hle/kernel/mutex.h b/src/core/hle/kernel/mutex.h index 1f843e979..871e2e562 100644 --- a/src/core/hle/kernel/mutex.h +++ b/src/core/hle/kernel/mutex.h @@ -21,6 +21,6 @@ Result ReleaseMutex(Handle handle); * @param handle Reference to handle for the newly created mutex * @param initial_locked Specifies if the mutex should be locked initially */ -Result CreateMutex(Handle& handle, bool initial_locked); +Handle CreateMutex(bool initial_locked); } // namespace -- cgit v1.2.3