diff options
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index e965b5b04..0f096ed6d 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -35,7 +35,7 @@ void Thread::Acquire(Thread* thread) { | |||
| 35 | ASSERT_MSG(!ShouldWait(thread), "object unavailable!"); | 35 | ASSERT_MSG(!ShouldWait(thread), "object unavailable!"); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | Thread::Thread(KernelCore& kernel) : WaitObject{kernel} {} | 38 | Thread::Thread(KernelCore& kernel) : SynchronizationObject{kernel} {} |
| 39 | Thread::~Thread() = default; | 39 | Thread::~Thread() = default; |
| 40 | 40 | ||
| 41 | void Thread::Stop() { | 41 | void Thread::Stop() { |
| @@ -215,7 +215,7 @@ void Thread::SetWaitSynchronizationOutput(s32 output) { | |||
| 215 | context.cpu_registers[1] = output; | 215 | context.cpu_registers[1] = output; |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | s32 Thread::GetWaitObjectIndex(std::shared_ptr<WaitObject> object) const { | 218 | s32 Thread::GetSynchronizationObjectIndex(std::shared_ptr<SynchronizationObject> object) const { |
| 219 | ASSERT_MSG(!wait_objects.empty(), "Thread is not waiting for anything"); | 219 | ASSERT_MSG(!wait_objects.empty(), "Thread is not waiting for anything"); |
| 220 | const auto match = std::find(wait_objects.rbegin(), wait_objects.rend(), object); | 220 | const auto match = std::find(wait_objects.rbegin(), wait_objects.rend(), object); |
| 221 | return static_cast<s32>(std::distance(match, wait_objects.rend()) - 1); | 221 | return static_cast<s32>(std::distance(match, wait_objects.rend()) - 1); |
| @@ -336,14 +336,16 @@ void Thread::ChangeCore(u32 core, u64 mask) { | |||
| 336 | SetCoreAndAffinityMask(core, mask); | 336 | SetCoreAndAffinityMask(core, mask); |
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | bool Thread::AllWaitObjectsReady() const { | 339 | bool Thread::AllSynchronizationObjectsReady() const { |
| 340 | return std::none_of( | 340 | return std::none_of(wait_objects.begin(), wait_objects.end(), |
| 341 | wait_objects.begin(), wait_objects.end(), | 341 | [this](const std::shared_ptr<SynchronizationObject>& object) { |
| 342 | [this](const std::shared_ptr<WaitObject>& object) { return object->ShouldWait(this); }); | 342 | return object->ShouldWait(this); |
| 343 | }); | ||
| 343 | } | 344 | } |
| 344 | 345 | ||
| 345 | bool Thread::InvokeWakeupCallback(ThreadWakeupReason reason, std::shared_ptr<Thread> thread, | 346 | bool Thread::InvokeWakeupCallback(ThreadWakeupReason reason, std::shared_ptr<Thread> thread, |
| 346 | std::shared_ptr<WaitObject> object, std::size_t index) { | 347 | std::shared_ptr<SynchronizationObject> object, |
| 348 | std::size_t index) { | ||
| 347 | ASSERT(wakeup_callback); | 349 | ASSERT(wakeup_callback); |
| 348 | return wakeup_callback(reason, std::move(thread), std::move(object), index); | 350 | return wakeup_callback(reason, std::move(thread), std::move(object), index); |
| 349 | } | 351 | } |