summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_thread.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-03-10 22:19:41 +0100
committerGitHub <noreply@github.com>2023-03-10 22:19:41 +0100
commit92c89312fcfe75d030de9e7bced94bc70dcba00b (patch)
tree2bdc9dcf0a110c0df5f0f4a78904bdcebe42a31f /src/core/hle/kernel/k_thread.cpp
parentMerge pull request #9928 from german77/super_nfp (diff)
parentkernel: add timer pointer to KThreadQueue (diff)
downloadyuzu-92c89312fcfe75d030de9e7bced94bc70dcba00b.tar
yuzu-92c89312fcfe75d030de9e7bced94bc70dcba00b.tar.gz
yuzu-92c89312fcfe75d030de9e7bced94bc70dcba00b.tar.bz2
yuzu-92c89312fcfe75d030de9e7bced94bc70dcba00b.tar.lz
yuzu-92c89312fcfe75d030de9e7bced94bc70dcba00b.tar.xz
yuzu-92c89312fcfe75d030de9e7bced94bc70dcba00b.tar.zst
yuzu-92c89312fcfe75d030de9e7bced94bc70dcba00b.zip
Diffstat (limited to 'src/core/hle/kernel/k_thread.cpp')
-rw-r--r--src/core/hle/kernel/k_thread.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp
index 15ae652f9..26e3700e4 100644
--- a/src/core/hle/kernel/k_thread.cpp
+++ b/src/core/hle/kernel/k_thread.cpp
@@ -1290,9 +1290,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()) {
@@ -1301,6 +1302,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);
}