diff options
| author | 2015-01-30 23:07:54 -0200 | |
|---|---|---|
| committer | 2015-02-02 15:37:01 -0200 | |
| commit | 664c79ff47054df845096e7e29d5cc437dfec2a2 (patch) | |
| tree | 1ebd682a7e75c964f2ac98f2dffbc5adba037442 /src/core/hle/kernel/thread.cpp | |
| parent | Service: Store function names as const char* instead of std::string (diff) | |
| download | yuzu-664c79ff47054df845096e7e29d5cc437dfec2a2.tar.gz yuzu-664c79ff47054df845096e7e29d5cc437dfec2a2.tar.xz yuzu-664c79ff47054df845096e7e29d5cc437dfec2a2.zip | |
Thread: Modernize two functions that slipped through previous rebases
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 56950ebd4..1ea5589cb 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -248,14 +248,13 @@ static void ThreadWakeupCallback(u64 parameter, int cycles_late) { | |||
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | 250 | ||
| 251 | void WakeThreadAfterDelay(Thread* thread, s64 nanoseconds) { | 251 | void Thread::WakeAfterDelay(s64 nanoseconds) { |
| 252 | // Don't schedule a wakeup if the thread wants to wait forever | 252 | // Don't schedule a wakeup if the thread wants to wait forever |
| 253 | if (nanoseconds == -1) | 253 | if (nanoseconds == -1) |
| 254 | return; | 254 | return; |
| 255 | _dbg_assert_(Kernel, thread != nullptr); | ||
| 256 | 255 | ||
| 257 | u64 microseconds = nanoseconds / 1000; | 256 | u64 microseconds = nanoseconds / 1000; |
| 258 | CoreTiming::ScheduleEvent(usToCycles(microseconds), ThreadWakeupEventType, thread->GetHandle()); | 257 | CoreTiming::ScheduleEvent(usToCycles(microseconds), ThreadWakeupEventType, GetHandle()); |
| 259 | } | 258 | } |
| 260 | 259 | ||
| 261 | void Thread::ReleaseWaitObject(WaitObject* wait_object) { | 260 | void Thread::ReleaseWaitObject(WaitObject* wait_object) { |
| @@ -418,7 +417,7 @@ void Thread::SetPriority(s32 priority) { | |||
| 418 | } | 417 | } |
| 419 | } | 418 | } |
| 420 | 419 | ||
| 421 | Handle SetupIdleThread() { | 420 | SharedPtr<Thread> SetupIdleThread() { |
| 422 | // We need to pass a few valid values to get around parameter checking in Thread::Create. | 421 | // We need to pass a few valid values to get around parameter checking in Thread::Create. |
| 423 | auto thread_res = Thread::Create("idle", Memory::KERNEL_MEMORY_VADDR, THREADPRIO_LOWEST, 0, | 422 | auto thread_res = Thread::Create("idle", Memory::KERNEL_MEMORY_VADDR, THREADPRIO_LOWEST, 0, |
| 424 | THREADPROCESSORID_0, 0, Kernel::DEFAULT_STACK_SIZE); | 423 | THREADPROCESSORID_0, 0, Kernel::DEFAULT_STACK_SIZE); |
| @@ -427,7 +426,7 @@ Handle SetupIdleThread() { | |||
| 427 | 426 | ||
| 428 | thread->idle = true; | 427 | thread->idle = true; |
| 429 | CallThread(thread.get()); | 428 | CallThread(thread.get()); |
| 430 | return thread->GetHandle(); | 429 | return thread; |
| 431 | } | 430 | } |
| 432 | 431 | ||
| 433 | SharedPtr<Thread> SetupMainThread(s32 priority, u32 stack_size) { | 432 | SharedPtr<Thread> SetupMainThread(s32 priority, u32 stack_size) { |