mirror of
https://github.com/yuzu-mirror/yuzu
synced 2024-11-27 19:00:17 +00:00
kernel: clean up waiting implementation
This commit is contained in:
parent
95b844dbae
commit
075155022e
2 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -487,9 +487,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -884,6 +882,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.
|
||||
|
@ -897,6 +896,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.
|
||||
|
@ -972,6 +972,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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue