diff options
| author | 2019-04-03 11:46:17 -0400 | |
|---|---|---|
| committer | 2019-04-03 11:46:17 -0400 | |
| 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.gz yuzu-74a4a5047017f9ed01d7139a1e6aee258382b91d.tar.xz yuzu-74a4a5047017f9ed01d7139a1e6aee258382b91d.zip | |
Merge pull request #2314 from lioncash/const
kernel/thread: Minor interface cleanup
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 @@ | |||
| 28 | 28 | ||
| 29 | namespace Kernel { | 29 | namespace Kernel { |
| 30 | 30 | ||
| 31 | bool Thread::ShouldWait(Thread* thread) const { | 31 | bool Thread::ShouldWait(const Thread* thread) const { |
| 32 | return status != ThreadStatus::Dead; | 32 | return status != ThreadStatus::Dead; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| @@ -233,16 +233,16 @@ void Thread::SetWaitSynchronizationOutput(s32 output) { | |||
| 233 | context.cpu_registers[1] = output; | 233 | context.cpu_registers[1] = output; |
| 234 | } | 234 | } |
| 235 | 235 | ||
| 236 | s32 Thread::GetWaitObjectIndex(WaitObject* object) const { | 236 | s32 Thread::GetWaitObjectIndex(const WaitObject* object) const { |
| 237 | ASSERT_MSG(!wait_objects.empty(), "Thread is not waiting for anything"); | 237 | ASSERT_MSG(!wait_objects.empty(), "Thread is not waiting for anything"); |
| 238 | auto match = std::find(wait_objects.rbegin(), wait_objects.rend(), object); | 238 | const auto match = std::find(wait_objects.rbegin(), wait_objects.rend(), object); |
| 239 | return static_cast<s32>(std::distance(match, wait_objects.rend()) - 1); | 239 | return static_cast<s32>(std::distance(match, wait_objects.rend()) - 1); |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | VAddr Thread::GetCommandBufferAddress() const { | 242 | VAddr Thread::GetCommandBufferAddress() const { |
| 243 | // Offset from the start of TLS at which the IPC command buffer begins. | 243 | // Offset from the start of TLS at which the IPC command buffer begins. |
| 244 | static constexpr int CommandHeaderOffset = 0x80; | 244 | constexpr u64 command_header_offset = 0x80; |
| 245 | return GetTLSAddress() + CommandHeaderOffset; | 245 | return GetTLSAddress() + command_header_offset; |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | void Thread::SetStatus(ThreadStatus new_status) { | 248 | void Thread::SetStatus(ThreadStatus new_status) { |
| @@ -371,7 +371,7 @@ void Thread::ChangeScheduler() { | |||
| 371 | system.CpuCore(processor_id).PrepareReschedule(); | 371 | system.CpuCore(processor_id).PrepareReschedule(); |
| 372 | } | 372 | } |
| 373 | 373 | ||
| 374 | bool Thread::AllWaitObjectsReady() { | 374 | bool Thread::AllWaitObjectsReady() const { |
| 375 | return std::none_of( | 375 | return std::none_of( |
| 376 | wait_objects.begin(), wait_objects.end(), | 376 | wait_objects.begin(), wait_objects.end(), |
| 377 | [this](const SharedPtr<WaitObject>& object) { return object->ShouldWait(this); }); | 377 | [this](const SharedPtr<WaitObject>& object) { return object->ShouldWait(this); }); |