diff options
author | bunnei <bunneidev@gmail.com> | 2019-03-22 03:18:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-22 03:18:36 +0100 |
commit | 7b6d516faa788c25e26c79e2e5d19915f73983a5 (patch) | |
tree | d477c1598d78ad60360f2ab08d3b201fff9f38bd /src/core/hle/kernel/svc.cpp | |
parent | Merge pull request #2274 from lioncash/include (diff) | |
parent | core/hle/kernel/mutex: Remove usages of global system accessors (diff) | |
download | yuzu-7b6d516faa788c25e26c79e2e5d19915f73983a5.tar yuzu-7b6d516faa788c25e26c79e2e5d19915f73983a5.tar.gz yuzu-7b6d516faa788c25e26c79e2e5d19915f73983a5.tar.bz2 yuzu-7b6d516faa788c25e26c79e2e5d19915f73983a5.tar.lz yuzu-7b6d516faa788c25e26c79e2e5d19915f73983a5.tar.xz yuzu-7b6d516faa788c25e26c79e2e5d19915f73983a5.tar.zst yuzu-7b6d516faa788c25e26c79e2e5d19915f73983a5.zip |
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 047fa0c19..a6a17efe7 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -551,9 +551,9 @@ static ResultCode ArbitrateLock(Handle holding_thread_handle, VAddr mutex_addr, return ERR_INVALID_ADDRESS; } - auto& handle_table = Core::CurrentProcess()->GetHandleTable(); - return Mutex::TryAcquire(handle_table, mutex_addr, holding_thread_handle, - requesting_thread_handle); + auto* const current_process = Core::System::GetInstance().Kernel().CurrentProcess(); + return current_process->GetMutex().TryAcquire(mutex_addr, holding_thread_handle, + requesting_thread_handle); } /// Unlock a mutex @@ -571,7 +571,8 @@ static ResultCode ArbitrateUnlock(VAddr mutex_addr) { return ERR_INVALID_ADDRESS; } - return Mutex::Release(mutex_addr); + auto* const current_process = Core::System::GetInstance().Kernel().CurrentProcess(); + return current_process->GetMutex().Release(mutex_addr); } enum class BreakType : u32 { @@ -1340,11 +1341,15 @@ static ResultCode WaitProcessWideKeyAtomic(VAddr mutex_addr, VAddr condition_var "called mutex_addr={:X}, condition_variable_addr={:X}, thread_handle=0x{:08X}, timeout={}", mutex_addr, condition_variable_addr, thread_handle, nano_seconds); - const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); + auto* const current_process = Core::System::GetInstance().Kernel().CurrentProcess(); + const auto& handle_table = current_process->GetHandleTable(); SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle); ASSERT(thread); - CASCADE_CODE(Mutex::Release(mutex_addr)); + const auto release_result = current_process->GetMutex().Release(mutex_addr); + if (release_result.IsError()) { + return release_result; + } SharedPtr<Thread> current_thread = GetCurrentThread(); current_thread->SetCondVarWaitAddress(condition_variable_addr); |