mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-14 15:28:13 -05:00
kernel: add timer pointer to KThreadQueue
This commit is contained in:
@ -1268,9 +1268,10 @@ Result KThread::Sleep(s64 timeout) {
|
||||
ASSERT(timeout > 0);
|
||||
|
||||
ThreadQueueImplForKThreadSleep wait_queue_(kernel);
|
||||
KHardwareTimer* timer{};
|
||||
{
|
||||
// Setup the scheduling lock and sleep.
|
||||
KScopedSchedulerLockAndSleep slp(kernel, this, timeout);
|
||||
KScopedSchedulerLockAndSleep slp(kernel, std::addressof(timer), this, timeout);
|
||||
|
||||
// Check if the thread should terminate.
|
||||
if (this->IsTerminationRequested()) {
|
||||
@ -1279,6 +1280,7 @@ Result KThread::Sleep(s64 timeout) {
|
||||
}
|
||||
|
||||
// Wait for the sleep to end.
|
||||
wait_queue_.SetHardwareTimer(timer);
|
||||
this->BeginWait(std::addressof(wait_queue_));
|
||||
SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::Sleep);
|
||||
}
|
||||
|
Reference in New Issue
Block a user