summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorGravatar Subv2016-12-14 12:13:02 -0500
committerGravatar Subv2016-12-14 12:35:01 -0500
commit5b1edc6ae70972d4a11eee1f1ff8fdff2122b5a2 (patch)
treeb6fbcc194effc5e05a608ebde0ea3c887720d920 /src/core/hle/kernel
parentProperly remove a thread from its wait_objects' waitlist when it is awoken by... (diff)
downloadyuzu-5b1edc6ae70972d4a11eee1f1ff8fdff2122b5a2.tar.gz
yuzu-5b1edc6ae70972d4a11eee1f1ff8fdff2122b5a2.tar.xz
yuzu-5b1edc6ae70972d4a11eee1f1ff8fdff2122b5a2.zip
Fixed the codestyle to match our clang-format rules.
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/kernel.cpp9
-rw-r--r--src/core/hle/kernel/thread.h10
2 files changed, 11 insertions, 8 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 2ddeffcdd..209d35270 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -50,9 +50,9 @@ SharedPtr<Thread> WaitObject::GetHighestPriorityReadyThread() {
50 if (thread->current_priority >= candidate_priority) 50 if (thread->current_priority >= candidate_priority)
51 continue; 51 continue;
52 52
53 bool ready_to_run = std::none_of(thread->wait_objects.begin(), thread->wait_objects.end(), [](const SharedPtr<WaitObject>& object) { 53 bool ready_to_run =
54 return object->ShouldWait(); 54 std::none_of(thread->wait_objects.begin(), thread->wait_objects.end(),
55 }); 55 [](const SharedPtr<WaitObject>& object) { return object->ShouldWait(); });
56 if (ready_to_run) { 56 if (ready_to_run) {
57 candidate = thread.get(); 57 candidate = thread.get();
58 candidate_priority = thread->current_priority; 58 candidate_priority = thread->current_priority;
@@ -83,7 +83,8 @@ void WaitObject::WakeupAllWaitingThreads() {
83 83
84 thread->SetWaitSynchronizationResult(RESULT_SUCCESS); 84 thread->SetWaitSynchronizationResult(RESULT_SUCCESS);
85 thread->ResumeFromWait(); 85 thread->ResumeFromWait();
86 // Note: Removing the thread from the object's waitlist will be done by GetHighestPriorityReadyThread 86 // Note: Removing the thread from the object's waitlist will be
87 // done by GetHighestPriorityReadyThread.
87 } 88 }
88} 89}
89 90
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index 4c254cb9d..238359fc5 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -178,17 +178,19 @@ public:
178 /// Mutexes currently held by this thread, which will be released when it exits. 178 /// Mutexes currently held by this thread, which will be released when it exits.
179 boost::container::flat_set<SharedPtr<Mutex>> held_mutexes; 179 boost::container::flat_set<SharedPtr<Mutex>> held_mutexes;
180 180
181 SharedPtr<Process> owner_process; ///< Process that owns this thread 181 SharedPtr<Process> owner_process; ///< Process that owns this thread
182 182
183 /// Objects that the thread is waiting on. 183 /// Objects that the thread is waiting on.
184 /// This is only populated when the thread should wait for all the objects to become ready. 184 /// This is only populated when the thread should wait for all the objects to become ready.
185 std::vector<SharedPtr<WaitObject>> wait_objects; 185 std::vector<SharedPtr<WaitObject>> wait_objects;
186 186
187 boost::container::flat_map<int, s32> wait_objects_index; ///< Mapping of Object ids to their position in the last waitlist that this object waited on. 187 /// Mapping of Object ids to their position in the last waitlist that this object waited on.
188 boost::container::flat_map<int, s32> wait_objects_index;
188 189
189 VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address 190 VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address
190 191
191 bool wait_set_output; ///< True if the WaitSynchronizationN output parameter should be set on thread wakeup 192 /// True if the WaitSynchronizationN output parameter should be set on thread wakeup.
193 bool wait_set_output;
192 194
193 std::string name; 195 std::string name;
194 196