summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-10-08 00:57:13 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-10-15 17:55:18 +0200
commit44e09e5f21915391672558940842b92e3a64cb1b (patch)
tree3a0e4db9cff1ad0ed7c70d4a6fc91695f8e1c137 /src/core/hle/kernel/kernel.cpp
parentKernel: Clang Format (diff)
downloadyuzu-44e09e5f21915391672558940842b92e3a64cb1b.tar
yuzu-44e09e5f21915391672558940842b92e3a64cb1b.tar.gz
yuzu-44e09e5f21915391672558940842b92e3a64cb1b.tar.bz2
yuzu-44e09e5f21915391672558940842b92e3a64cb1b.tar.lz
yuzu-44e09e5f21915391672558940842b92e3a64cb1b.tar.xz
yuzu-44e09e5f21915391672558940842b92e3a64cb1b.tar.zst
yuzu-44e09e5f21915391672558940842b92e3a64cb1b.zip
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 77edbcd1f..002c5af2b 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -15,6 +15,7 @@
#include "core/core_timing_util.h"
#include "core/hle/kernel/address_arbiter.h"
#include "core/hle/kernel/client_port.h"
+#include "core/hle/kernel/errors.h"
#include "core/hle/kernel/handle_table.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/process.h"
@@ -60,12 +61,8 @@ static void ThreadWakeupCallback(u64 thread_handle, [[maybe_unused]] s64 cycles_
if (thread->HasWakeupCallback()) {
resume = thread->InvokeWakeupCallback(ThreadWakeupReason::Timeout, thread, nullptr, 0);
}
- }
-
- if (thread->GetMutexWaitAddress() != 0 || thread->GetCondVarWaitAddress() != 0 ||
- thread->GetWaitHandle() != 0) {
- ASSERT(thread->GetStatus() == ThreadStatus::WaitMutex ||
- thread->GetStatus() == ThreadStatus::WaitCondVar);
+ } else if (thread->GetStatus() == ThreadStatus::WaitMutex ||
+ thread->GetStatus() == ThreadStatus::WaitCondVar) {
thread->SetMutexWaitAddress(0);
thread->SetCondVarWaitAddress(0);
thread->SetWaitHandle(0);
@@ -85,6 +82,10 @@ static void ThreadWakeupCallback(u64 thread_handle, [[maybe_unused]] s64 cycles_
}
if (resume) {
+ if (thread->GetStatus() == ThreadStatus::WaitCondVar ||
+ thread->GetStatus() == ThreadStatus::WaitArb) {
+ thread->SetWaitSynchronizationResult(RESULT_TIMEOUT);
+ }
thread->ResumeFromWait();
}
}