summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/mutex.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2014-05-20 23:23:58 -0400
committerGravatar bunnei2014-05-20 23:23:58 -0400
commiteb537c560a33db9955413a96afd3b98203a729fe (patch)
tree6bb55926f3b811a578a2680b0cd454476a144244 /src/core/hle/kernel/mutex.cpp
parentmutex: initial commit of HLE module (diff)
downloadyuzu-eb537c560a33db9955413a96afd3b98203a729fe.tar.gz
yuzu-eb537c560a33db9955413a96afd3b98203a729fe.tar.xz
yuzu-eb537c560a33db9955413a96afd3b98203a729fe.zip
mutex: refactored the interface to code to return a Mutex* handle
Diffstat (limited to 'src/core/hle/kernel/mutex.cpp')
-rw-r--r--src/core/hle/kernel/mutex.cpp14
1 files changed, 12 insertions, 2 deletions
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) {
102 * @param handle Reference to handle for the newly created mutex 102 * @param handle Reference to handle for the newly created mutex
103 * @param initial_locked Specifies if the mutex should be locked initially 103 * @param initial_locked Specifies if the mutex should be locked initially
104 */ 104 */
105Result CreateMutex(Handle& handle, bool initial_locked) { 105Mutex* CreateMutex(Handle& handle, bool initial_locked) {
106 Mutex* mutex = new Mutex; 106 Mutex* mutex = new Mutex;
107 handle = Kernel::g_object_pool.Create(mutex); 107 handle = Kernel::g_object_pool.Create(mutex);
108 108
@@ -116,7 +116,17 @@ Result CreateMutex(Handle& handle, bool initial_locked) {
116 } else { 116 } else {
117 mutex->lock_thread = -1; 117 mutex->lock_thread = -1;
118 } 118 }
119 return 0; 119 return mutex;
120}
121
122/**
123 * Creates a mutex
124 * @param initial_locked Specifies if the mutex should be locked initially
125 */
126Handle CreateMutex(bool initial_locked) {
127 Handle handle;
128 Mutex* mutex = CreateMutex(handle, initial_locked);
129 return handle;
120} 130}
121 131
122} // namespace 132} // namespace