aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/svc.cpp
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2015-01-17 22:23:49 -0500
committerGravatar bunnei <bunneidev@gmail.com>2015-01-21 19:10:24 -0500
commitaa01c57ae9d73e41b65d37860ca6fbb91caba33a (patch)
tree904936860b1e8319ec5edc3a1e0e6c2c12f01d9f /src/core/hle/svc.cpp
parent627e96fc15f99eea0f1c5ccdb46d85cadb3efd69 (diff)
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 23885f12..a27aa626 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) {
LOG_TRACE(Kernel_SVC, "called handle=0x%08X(%s:%s), nanoseconds=%lld", handle,
object->GetTypeName().c_str(), object->GetName().c_str(), nano_seconds);
- ResultVal<bool> wait = object->WaitSynchronization();
+ ResultVal<bool> wait = object->Wait();
// Check for next thread to schedule
if (wait.Succeeded() && *wait) {
@@ -137,6 +137,8 @@ static Result WaitSynchronization1(Handle handle, s64 nano_seconds) {
Kernel::GetCurrentThread()->SetWaitAll(false);
HLE::Reschedule(__func__);
+ } else {
+ object->Acquire();
}
return wait.Code().raw;
@@ -163,15 +165,14 @@ static Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count,
if (object == nullptr)
return InvalidHandle(ErrorModule::Kernel).raw;
- ResultVal<bool> wait = object->WaitSynchronization(handle_index);
+ ResultVal<bool> wait = object->Wait(handle_index);
wait_thread = (wait.Succeeded() && *wait);
// If this object waited and we are waiting on all objects to synchronize
- if (wait_thread && wait_all) {
+ if (wait_thread && wait_all)
// Enforce later on that this thread does not continue
wait_all_succeeded = true;
- }
// If this object synchronized and we are not waiting on all objects to synchronize
if (!wait_thread && !wait_all)