|
|
|
@ -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);
|
|
|
|
|
|
|
|
|
|