summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2019-04-03 11:46:17 -0400
committerGravatar GitHub2019-04-03 11:46:17 -0400
commit74a4a5047017f9ed01d7139a1e6aee258382b91d (patch)
tree49df4085cc5210019d561ab1a0abe787a1dbc514 /src/core/hle/kernel/thread.cpp
parentMerge pull request #2326 from lioncash/translation (diff)
parentkernel/thread: Make AllWaitObjectsReady() a const qualified member function (diff)
downloadyuzu-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.cpp12
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
29namespace Kernel { 29namespace Kernel {
30 30
31bool Thread::ShouldWait(Thread* thread) const { 31bool 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
236s32 Thread::GetWaitObjectIndex(WaitObject* object) const { 236s32 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
242VAddr Thread::GetCommandBufferAddress() const { 242VAddr 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
248void Thread::SetStatus(ThreadStatus new_status) { 248void 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
374bool Thread::AllWaitObjectsReady() { 374bool 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); });