diff options
| author | 2019-04-01 18:19:42 -0400 | |
|---|---|---|
| committer | 2019-04-01 18:19:45 -0400 | |
| commit | 20cc0b8d3cd46dfc8eed7689f93b6d41f320c709 (patch) | |
| tree | b1f78f8b7a5364d9fb17498eb469b414160827d8 /src | |
| parent | kernel/thread: Avoid sign conversion within GetCommandBufferAddress() (diff) | |
| download | yuzu-20cc0b8d3cd46dfc8eed7689f93b6d41f320c709.tar.gz yuzu-20cc0b8d3cd46dfc8eed7689f93b6d41f320c709.tar.xz yuzu-20cc0b8d3cd46dfc8eed7689f93b6d41f320c709.zip | |
kernel/wait_object: Make ShouldWait() take thread members by pointer-to-const
Given this is intended as a querying function, it doesn't make sense to
allow the implementer to modify the state of the given thread.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/process.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/readable_event.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/readable_event.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/server_port.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/server_port.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/server_session.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/server_session.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/wait_object.h | 2 |
11 files changed, 11 insertions, 11 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index b0b7af76b..6e98d78a2 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -247,7 +247,7 @@ void Process::Acquire(Thread* thread) { | |||
| 247 | ASSERT_MSG(!ShouldWait(thread), "Object unavailable!"); | 247 | ASSERT_MSG(!ShouldWait(thread), "Object unavailable!"); |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | bool Process::ShouldWait(Thread* thread) const { | 250 | bool Process::ShouldWait(const Thread* thread) const { |
| 251 | return !is_signaled; | 251 | return !is_signaled; |
| 252 | } | 252 | } |
| 253 | 253 | ||
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 732d12170..23f898b0c 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h | |||
| @@ -237,7 +237,7 @@ private: | |||
| 237 | ~Process() override; | 237 | ~Process() override; |
| 238 | 238 | ||
| 239 | /// Checks if the specified thread should wait until this process is available. | 239 | /// Checks if the specified thread should wait until this process is available. |
| 240 | bool ShouldWait(Thread* thread) const override; | 240 | bool ShouldWait(const Thread* thread) const override; |
| 241 | 241 | ||
| 242 | /// Acquires/locks this process for the specified thread if it's available. | 242 | /// Acquires/locks this process for the specified thread if it's available. |
| 243 | void Acquire(Thread* thread) override; | 243 | void Acquire(Thread* thread) override; |
diff --git a/src/core/hle/kernel/readable_event.cpp b/src/core/hle/kernel/readable_event.cpp index 0e5083f70..c2b798a4e 100644 --- a/src/core/hle/kernel/readable_event.cpp +++ b/src/core/hle/kernel/readable_event.cpp | |||
| @@ -14,7 +14,7 @@ namespace Kernel { | |||
| 14 | ReadableEvent::ReadableEvent(KernelCore& kernel) : WaitObject{kernel} {} | 14 | ReadableEvent::ReadableEvent(KernelCore& kernel) : WaitObject{kernel} {} |
| 15 | ReadableEvent::~ReadableEvent() = default; | 15 | ReadableEvent::~ReadableEvent() = default; |
| 16 | 16 | ||
| 17 | bool ReadableEvent::ShouldWait(Thread* thread) const { | 17 | bool ReadableEvent::ShouldWait(const Thread* thread) const { |
| 18 | return !signaled; | 18 | return !signaled; |
| 19 | } | 19 | } |
| 20 | 20 | ||
diff --git a/src/core/hle/kernel/readable_event.h b/src/core/hle/kernel/readable_event.h index 77a9c362c..2eb9dcbb7 100644 --- a/src/core/hle/kernel/readable_event.h +++ b/src/core/hle/kernel/readable_event.h | |||
| @@ -36,7 +36,7 @@ public: | |||
| 36 | return HANDLE_TYPE; | 36 | return HANDLE_TYPE; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | bool ShouldWait(Thread* thread) const override; | 39 | bool ShouldWait(const Thread* thread) const override; |
| 40 | void Acquire(Thread* thread) override; | 40 | void Acquire(Thread* thread) override; |
| 41 | 41 | ||
| 42 | /// Unconditionally clears the readable event's state. | 42 | /// Unconditionally clears the readable event's state. |
diff --git a/src/core/hle/kernel/server_port.cpp b/src/core/hle/kernel/server_port.cpp index 0e1515c89..708fdf9e1 100644 --- a/src/core/hle/kernel/server_port.cpp +++ b/src/core/hle/kernel/server_port.cpp | |||
| @@ -30,7 +30,7 @@ void ServerPort::AppendPendingSession(SharedPtr<ServerSession> pending_session) | |||
| 30 | pending_sessions.push_back(std::move(pending_session)); | 30 | pending_sessions.push_back(std::move(pending_session)); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | bool ServerPort::ShouldWait(Thread* thread) const { | 33 | bool ServerPort::ShouldWait(const Thread* thread) const { |
| 34 | // If there are no pending sessions, we wait until a new one is added. | 34 | // If there are no pending sessions, we wait until a new one is added. |
| 35 | return pending_sessions.empty(); | 35 | return pending_sessions.empty(); |
| 36 | } | 36 | } |
diff --git a/src/core/hle/kernel/server_port.h b/src/core/hle/kernel/server_port.h index 9bc667cf2..76293cb8b 100644 --- a/src/core/hle/kernel/server_port.h +++ b/src/core/hle/kernel/server_port.h | |||
| @@ -75,7 +75,7 @@ public: | |||
| 75 | /// waiting to be accepted by this port. | 75 | /// waiting to be accepted by this port. |
| 76 | void AppendPendingSession(SharedPtr<ServerSession> pending_session); | 76 | void AppendPendingSession(SharedPtr<ServerSession> pending_session); |
| 77 | 77 | ||
| 78 | bool ShouldWait(Thread* thread) const override; | 78 | bool ShouldWait(const Thread* thread) const override; |
| 79 | void Acquire(Thread* thread) override; | 79 | void Acquire(Thread* thread) override; |
| 80 | 80 | ||
| 81 | private: | 81 | private: |
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index 4d8a337a7..40cec143e 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp | |||
| @@ -46,7 +46,7 @@ ResultVal<SharedPtr<ServerSession>> ServerSession::Create(KernelCore& kernel, st | |||
| 46 | return MakeResult(std::move(server_session)); | 46 | return MakeResult(std::move(server_session)); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | bool ServerSession::ShouldWait(Thread* thread) const { | 49 | bool ServerSession::ShouldWait(const Thread* thread) const { |
| 50 | // Closed sessions should never wait, an error will be returned from svcReplyAndReceive. | 50 | // Closed sessions should never wait, an error will be returned from svcReplyAndReceive. |
| 51 | if (parent->client == nullptr) | 51 | if (parent->client == nullptr) |
| 52 | return false; | 52 | return false; |
diff --git a/src/core/hle/kernel/server_session.h b/src/core/hle/kernel/server_session.h index aea4ccfeb..79b84bade 100644 --- a/src/core/hle/kernel/server_session.h +++ b/src/core/hle/kernel/server_session.h | |||
| @@ -82,7 +82,7 @@ public: | |||
| 82 | */ | 82 | */ |
| 83 | ResultCode HandleSyncRequest(SharedPtr<Thread> thread); | 83 | ResultCode HandleSyncRequest(SharedPtr<Thread> thread); |
| 84 | 84 | ||
| 85 | bool ShouldWait(Thread* thread) const override; | 85 | bool ShouldWait(const Thread* thread) const override; |
| 86 | 86 | ||
| 87 | void Acquire(Thread* thread) override; | 87 | void Acquire(Thread* thread) override; |
| 88 | 88 | ||
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 332f96287..0e4f6c041 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 | ||
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 1e36a9615..db563708b 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -111,7 +111,7 @@ public: | |||
| 111 | return HANDLE_TYPE; | 111 | return HANDLE_TYPE; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | bool ShouldWait(Thread* thread) const override; | 114 | bool ShouldWait(const Thread* thread) const override; |
| 115 | void Acquire(Thread* thread) override; | 115 | void Acquire(Thread* thread) override; |
| 116 | 116 | ||
| 117 | /** | 117 | /** |
diff --git a/src/core/hle/kernel/wait_object.h b/src/core/hle/kernel/wait_object.h index 5987fb971..04464a51a 100644 --- a/src/core/hle/kernel/wait_object.h +++ b/src/core/hle/kernel/wait_object.h | |||
| @@ -24,7 +24,7 @@ public: | |||
| 24 | * @param thread The thread about which we're deciding. | 24 | * @param thread The thread about which we're deciding. |
| 25 | * @return True if the current thread should wait due to this object being unavailable | 25 | * @return True if the current thread should wait due to this object being unavailable |
| 26 | */ | 26 | */ |
| 27 | virtual bool ShouldWait(Thread* thread) const = 0; | 27 | virtual bool ShouldWait(const Thread* thread) const = 0; |
| 28 | 28 | ||
| 29 | /// Acquire/lock the object for the specified thread if it is available | 29 | /// Acquire/lock the object for the specified thread if it is available |
| 30 | virtual void Acquire(Thread* thread) = 0; | 30 | virtual void Acquire(Thread* thread) = 0; |