mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-15 23:54:24 -04:00
kern: improve KLightLock accuracy
This commit is contained in:
parent
1448068b69
commit
4ac94e9179
3 changed files with 15 additions and 8 deletions
|
@ -38,6 +38,7 @@ namespace ams::kern {
|
|||
if (AMS_LIKELY(cur_thread->GetState() == KThread::ThreadState_Runnable)) {
|
||||
cur_thread->SetState(KThread::ThreadState_Waiting);
|
||||
}
|
||||
|
||||
if (owner_thread->IsSuspended()) {
|
||||
owner_thread->ContinueIfHasKernelWaiters();
|
||||
}
|
||||
|
@ -75,6 +76,10 @@ namespace ams::kern {
|
|||
if (AMS_LIKELY(next_owner->GetState() == KThread::ThreadState_Waiting)) {
|
||||
next_owner->SetState(KThread::ThreadState_Runnable);
|
||||
}
|
||||
|
||||
if (next_owner->IsSuspended()) {
|
||||
next_owner->ContinueIfHasKernelWaiters();
|
||||
}
|
||||
}
|
||||
|
||||
/* We may have unsuspended in the process of acquiring the lock, so we'll re-suspend now if so. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue