summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2022-07-07 23:31:49 +0200
committerGitHub <noreply@github.com>2022-07-07 23:31:49 +0200
commit7e75593c20bd0ad3cbb4915ee18bc7a3392f5651 (patch)
treef0d9c1ffb8093eb36d05cee6f694d343e9d5edf8 /src
parentMerge pull request #8492 from german77/no_more_errors (diff)
parentkernel: clean up waiting implementation (diff)
downloadyuzu-7e75593c20bd0ad3cbb4915ee18bc7a3392f5651.tar
yuzu-7e75593c20bd0ad3cbb4915ee18bc7a3392f5651.tar.gz
yuzu-7e75593c20bd0ad3cbb4915ee18bc7a3392f5651.tar.bz2
yuzu-7e75593c20bd0ad3cbb4915ee18bc7a3392f5651.tar.lz
yuzu-7e75593c20bd0ad3cbb4915ee18bc7a3392f5651.tar.xz
yuzu-7e75593c20bd0ad3cbb4915ee18bc7a3392f5651.tar.zst
yuzu-7e75593c20bd0ad3cbb4915ee18bc7a3392f5651.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_process.cpp2
-rw-r--r--src/core/hle/kernel/k_thread.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp
index 183c693e3..b662788b3 100644
--- a/src/core/hle/kernel/k_process.cpp
+++ b/src/core/hle/kernel/k_process.cpp
@@ -161,7 +161,7 @@ bool KProcess::ReleaseUserException(KThread* thread) {
std::addressof(num_waiters),
reinterpret_cast<uintptr_t>(std::addressof(exception_thread)));
next != nullptr) {
- next->SetState(ThreadState::Runnable);
+ next->EndWait(ResultSuccess);
}
KScheduler::SetSchedulerUpdateNeeded(kernel);
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp
index 23bf7425a..50cb5fc90 100644
--- a/src/core/hle/kernel/k_thread.cpp
+++ b/src/core/hle/kernel/k_thread.cpp
@@ -480,9 +480,7 @@ void KThread::Unpin() {
// Resume any threads that began waiting on us while we were pinned.
for (auto it = pinned_waiter_list.begin(); it != pinned_waiter_list.end(); ++it) {
- if (it->GetState() == ThreadState::Waiting) {
- it->SetState(ThreadState::Runnable);
- }
+ it->EndWait(ResultSuccess);
}
}
@@ -877,6 +875,7 @@ void KThread::AddWaiterImpl(KThread* thread) {
// Keep track of how many kernel waiters we have.
if (IsKernelAddressKey(thread->GetAddressKey())) {
ASSERT((num_kernel_waiters++) >= 0);
+ KScheduler::SetSchedulerUpdateNeeded(kernel);
}
// Insert the waiter.
@@ -890,6 +889,7 @@ void KThread::RemoveWaiterImpl(KThread* thread) {
// Keep track of how many kernel waiters we have.
if (IsKernelAddressKey(thread->GetAddressKey())) {
ASSERT((num_kernel_waiters--) > 0);
+ KScheduler::SetSchedulerUpdateNeeded(kernel);
}
// Remove the waiter.
@@ -965,6 +965,7 @@ KThread* KThread::RemoveWaiterByKey(s32* out_num_waiters, VAddr key) {
// Keep track of how many kernel waiters we have.
if (IsKernelAddressKey(thread->GetAddressKey())) {
ASSERT((num_kernel_waiters--) > 0);
+ KScheduler::SetSchedulerUpdateNeeded(kernel);
}
it = waiter_list.erase(it);