diff options
author | bunnei <bunneidev@gmail.com> | 2019-04-03 17:46:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-03 17:46:17 +0200 |
commit | 74a4a5047017f9ed01d7139a1e6aee258382b91d (patch) | |
tree | 49df4085cc5210019d561ab1a0abe787a1dbc514 /src/core/hle/kernel/thread.cpp | |
parent | Merge pull request #2326 from lioncash/translation (diff) | |
parent | kernel/thread: Make AllWaitObjectsReady() a const qualified member function (diff) | |
download | yuzu-74a4a5047017f9ed01d7139a1e6aee258382b91d.tar yuzu-74a4a5047017f9ed01d7139a1e6aee258382b91d.tar.gz yuzu-74a4a5047017f9ed01d7139a1e6aee258382b91d.tar.bz2 yuzu-74a4a5047017f9ed01d7139a1e6aee258382b91d.tar.lz yuzu-74a4a5047017f9ed01d7139a1e6aee258382b91d.tar.xz yuzu-74a4a5047017f9ed01d7139a1e6aee258382b91d.tar.zst yuzu-74a4a5047017f9ed01d7139a1e6aee258382b91d.zip |
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 3ec3710b2..1b891f632 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -28,7 +28,7 @@ namespace Kernel { -bool Thread::ShouldWait(Thread* thread) const { +bool Thread::ShouldWait(const Thread* thread) const { return status != ThreadStatus::Dead; } @@ -233,16 +233,16 @@ void Thread::SetWaitSynchronizationOutput(s32 output) { context.cpu_registers[1] = output; } -s32 Thread::GetWaitObjectIndex(WaitObject* object) const { +s32 Thread::GetWaitObjectIndex(const WaitObject* object) const { ASSERT_MSG(!wait_objects.empty(), "Thread is not waiting for anything"); - auto match = std::find(wait_objects.rbegin(), wait_objects.rend(), object); + const auto match = std::find(wait_objects.rbegin(), wait_objects.rend(), object); return static_cast<s32>(std::distance(match, wait_objects.rend()) - 1); } VAddr Thread::GetCommandBufferAddress() const { // Offset from the start of TLS at which the IPC command buffer begins. - static constexpr int CommandHeaderOffset = 0x80; - return GetTLSAddress() + CommandHeaderOffset; + constexpr u64 command_header_offset = 0x80; + return GetTLSAddress() + command_header_offset; } void Thread::SetStatus(ThreadStatus new_status) { @@ -371,7 +371,7 @@ void Thread::ChangeScheduler() { system.CpuCore(processor_id).PrepareReschedule(); } -bool Thread::AllWaitObjectsReady() { +bool Thread::AllWaitObjectsReady() const { return std::none_of( wait_objects.begin(), wait_objects.end(), [this](const SharedPtr<WaitObject>& object) { return object->ShouldWait(this); }); |