diff options
| author | 2019-03-16 00:43:09 -0400 | |
|---|---|---|
| committer | 2019-03-16 00:43:09 -0400 | |
| commit | bdf2da4ee811790014f900b165720c983dbf0b65 (patch) | |
| tree | ab2de1c608f4860af3d75863f9a5a766e09e6710 /src/core/hle/kernel/thread.cpp | |
| parent | Merge pull request #2237 from bunnei/cache-host-addr (diff) | |
| parent | kernel/thread: Move thread exiting logic from ExitCurrentThread to svcExitThread (diff) | |
| download | yuzu-bdf2da4ee811790014f900b165720c983dbf0b65.tar.gz yuzu-bdf2da4ee811790014f900b165720c983dbf0b65.tar.xz yuzu-bdf2da4ee811790014f900b165720c983dbf0b65.zip | |
Merge pull request #2242 from lioncash/thread-fn
kernel/thread: Remove WaitCurrentThread_Sleep() and ExitCurrentThread()
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index eb54d6651..2e712c9cb 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -68,11 +68,6 @@ void Thread::Stop() { | |||
| 68 | owner_process->FreeTLSSlot(tls_address); | 68 | owner_process->FreeTLSSlot(tls_address); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | void WaitCurrentThread_Sleep() { | ||
| 72 | Thread* thread = GetCurrentThread(); | ||
| 73 | thread->SetStatus(ThreadStatus::WaitSleep); | ||
| 74 | } | ||
| 75 | |||
| 76 | void ExitCurrentThread() { | 71 | void ExitCurrentThread() { |
| 77 | Thread* thread = GetCurrentThread(); | 72 | Thread* thread = GetCurrentThread(); |
| 78 | thread->Stop(); | 73 | thread->Stop(); |
| @@ -391,6 +386,14 @@ void Thread::SetActivity(ThreadActivity value) { | |||
| 391 | } | 386 | } |
| 392 | } | 387 | } |
| 393 | 388 | ||
| 389 | void Thread::Sleep(s64 nanoseconds) { | ||
| 390 | // Sleep current thread and check for next thread to schedule | ||
| 391 | SetStatus(ThreadStatus::WaitSleep); | ||
| 392 | |||
| 393 | // Create an event to wake the thread up after the specified nanosecond delay has passed | ||
| 394 | WakeAfterDelay(nanoseconds); | ||
| 395 | } | ||
| 396 | |||
| 394 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 397 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 395 | 398 | ||
| 396 | /** | 399 | /** |