diff options
| author | bunnei <bunneidev@gmail.com> | 2019-03-16 00:43:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-16 00:43:09 -0400 |
| commit | 238a5ac1a79234b6f4a3ee2a36f53cc8a9d4df5d (patch) | |
| tree | ab2de1c608f4860af3d75863f9a5a766e09e6710 /src/core/hle/kernel/thread.cpp | |
| parent | 25de9134e7bf4e94948a97e7e7c1febe31463f82 (diff) | |
| parent | 0032bede5a880a44bffcb702eb8fe858c214dc39 (diff) | |
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 eb54d66516..2e712c9cb6 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -68,11 +68,6 @@ void Thread::Stop() { owner_process->FreeTLSSlot(tls_address); } -void WaitCurrentThread_Sleep() { - Thread* thread = GetCurrentThread(); - thread->SetStatus(ThreadStatus::WaitSleep); -} - void ExitCurrentThread() { Thread* thread = GetCurrentThread(); thread->Stop(); @@ -391,6 +386,14 @@ void Thread::SetActivity(ThreadActivity value) { } } +void Thread::Sleep(s64 nanoseconds) { + // Sleep current thread and check for next thread to schedule + SetStatus(ThreadStatus::WaitSleep); + + // Create an event to wake the thread up after the specified nanosecond delay has passed + WakeAfterDelay(nanoseconds); +} + //////////////////////////////////////////////////////////////////////////////////////////////////// /** |
