mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-10 06:01:52 +00:00
kern: update KConditionVariable::WaitForAddress/Wait
This commit is contained in:
parent
19b253fd17
commit
504472af4e
1 changed files with 11 additions and 12 deletions
|
@ -102,14 +102,13 @@ namespace ams::kern {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MESOSPHERE_ASSERT(owner_thread.IsNotNull());
|
MESOSPHERE_ASSERT(owner_thread.IsNotNull());
|
||||||
}
|
|
||||||
|
|
||||||
/* Remove the thread as a waiter from the lock owner. */
|
/* Remove the thread as a waiter from the lock owner. */
|
||||||
{
|
{
|
||||||
KScopedSchedulerLock sl;
|
KScopedSchedulerLock sl;
|
||||||
KThread *owner_thread = cur_thread->GetLockOwner();
|
if (KThread *mutex_owner = cur_thread->GetLockOwner(); mutex_owner != nullptr) {
|
||||||
if (owner_thread != nullptr) {
|
mutex_owner->RemoveWaiter(cur_thread);
|
||||||
owner_thread->RemoveWaiter(cur_thread);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,11 +249,6 @@ namespace ams::kern {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cancel the timer wait. */
|
|
||||||
if (timer != nullptr) {
|
|
||||||
timer->CancelTask(cur_thread);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Remove from the condition variable. */
|
/* Remove from the condition variable. */
|
||||||
{
|
{
|
||||||
KScopedSchedulerLock sl;
|
KScopedSchedulerLock sl;
|
||||||
|
@ -269,6 +263,11 @@ namespace ams::kern {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Cancel the timer wait. */
|
||||||
|
if (timer != nullptr) {
|
||||||
|
timer->CancelTask(cur_thread);
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the result. */
|
/* Get the result. */
|
||||||
KSynchronizationObject *dummy;
|
KSynchronizationObject *dummy;
|
||||||
return cur_thread->GetWaitResult(std::addressof(dummy));
|
return cur_thread->GetWaitResult(std::addressof(dummy));
|
||||||
|
|
Loading…
Reference in a new issue