summaryrefslogtreecommitdiff
path: root/src/core/hle/svc.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2015-01-17 22:23:49 -0500
committerGravatar bunnei2015-01-21 19:10:24 -0500
commitaa01c57ae9d73e41b65d37860ca6fbb91caba33a (patch)
tree904936860b1e8319ec5edc3a1e0e6c2c12f01d9f /src/core/hle/svc.cpp
parentWaitSynchronizationN: Handle case where handles=nullptr. (diff)
downloadyuzu-aa01c57ae9d73e41b65d37860ca6fbb91caba33a.tar.gz
yuzu-aa01c57ae9d73e41b65d37860ca6fbb91caba33a.tar.xz
yuzu-aa01c57ae9d73e41b65d37860ca6fbb91caba33a.zip
Kernel: Separate WaitSynchronization into Wait and Acquire methods.
Diffstat (limited to 'src/core/hle/svc.cpp')
-rw-r--r--src/core/hle/svc.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 23885f129..a27aa6269 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -127,7 +127,7 @@ static Result WaitSynchronization1(Handle handle, s64 nano_seconds) {
127 LOG_TRACE(Kernel_SVC, "called handle=0x%08X(%s:%s), nanoseconds=%lld", handle, 127 LOG_TRACE(Kernel_SVC, "called handle=0x%08X(%s:%s), nanoseconds=%lld", handle,
128 object->GetTypeName().c_str(), object->GetName().c_str(), nano_seconds); 128 object->GetTypeName().c_str(), object->GetName().c_str(), nano_seconds);
129 129
130 ResultVal<bool> wait = object->WaitSynchronization(); 130 ResultVal<bool> wait = object->Wait();
131 131
132 // Check for next thread to schedule 132 // Check for next thread to schedule
133 if (wait.Succeeded() && *wait) { 133 if (wait.Succeeded() && *wait) {
@@ -137,6 +137,8 @@ static Result WaitSynchronization1(Handle handle, s64 nano_seconds) {
137 Kernel::GetCurrentThread()->SetWaitAll(false); 137 Kernel::GetCurrentThread()->SetWaitAll(false);
138 138
139 HLE::Reschedule(__func__); 139 HLE::Reschedule(__func__);
140 } else {
141 object->Acquire();
140 } 142 }
141 143
142 return wait.Code().raw; 144 return wait.Code().raw;
@@ -163,15 +165,14 @@ static Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count,
163 if (object == nullptr) 165 if (object == nullptr)
164 return InvalidHandle(ErrorModule::Kernel).raw; 166 return InvalidHandle(ErrorModule::Kernel).raw;
165 167
166 ResultVal<bool> wait = object->WaitSynchronization(handle_index); 168 ResultVal<bool> wait = object->Wait(handle_index);
167 169
168 wait_thread = (wait.Succeeded() && *wait); 170 wait_thread = (wait.Succeeded() && *wait);
169 171
170 // If this object waited and we are waiting on all objects to synchronize 172 // If this object waited and we are waiting on all objects to synchronize
171 if (wait_thread && wait_all) { 173 if (wait_thread && wait_all)
172 // Enforce later on that this thread does not continue 174 // Enforce later on that this thread does not continue
173 wait_all_succeeded = true; 175 wait_all_succeeded = true;
174 }
175 176
176 // If this object synchronized and we are not waiting on all objects to synchronize 177 // If this object synchronized and we are not waiting on all objects to synchronize
177 if (!wait_thread && !wait_all) 178 if (!wait_thread && !wait_all)