summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.h
diff options
context:
space:
mode:
authorGravatar Subv2017-01-04 10:53:01 -0500
committerGravatar Subv2017-01-05 09:40:14 -0500
commitfd95b6ee2606da4cd47c5f2916ad3b4f86c0e0f4 (patch)
tree5a3d1487e24f089b68358ddd8984c12e65623055 /src/core/hle/kernel/thread.h
parentKernel: Use different thread statuses when a thread calls WaitSynchronization... (diff)
downloadyuzu-fd95b6ee2606da4cd47c5f2916ad3b4f86c0e0f4.tar.gz
yuzu-fd95b6ee2606da4cd47c5f2916ad3b4f86c0e0f4.tar.xz
yuzu-fd95b6ee2606da4cd47c5f2916ad3b4f86c0e0f4.zip
Kernel: Remove Thread::wait_objects_index and use wait_objects to hold all the objects that a thread is waiting on.
Diffstat (limited to 'src/core/hle/kernel/thread.h')
-rw-r--r--src/core/hle/kernel/thread.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index 6cd8c20e2..af72b76ea 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -135,13 +135,14 @@ public:
135 135
136 /** 136 /**
137 * Retrieves the index that this particular object occupies in the list of objects 137 * Retrieves the index that this particular object occupies in the list of objects
138 * that the thread passed to WaitSynchronizationN. 138 * that the thread passed to WaitSynchronizationN, starting the search from the last element.
139 * It is used to set the output value of WaitSynchronizationN when the thread is awakened. 139 * It is used to set the output value of WaitSynchronizationN when the thread is awakened.
140 * When a thread wakes up due to an object signal, the kernel will use the index of the last
141 * matching object in the wait objects list in case of having multiple instances of the same
142 * object in the list.
140 * @param object Object to query the index of. 143 * @param object Object to query the index of.
141 */ 144 */
142 s32 GetWaitObjectIndex(const WaitObject* object) const { 145 s32 GetWaitObjectIndex(WaitObject* object) const;
143 return wait_objects_index.at(object->GetObjectId());
144 }
145 146
146 /** 147 /**
147 * Stops a thread, invalidating it from further use 148 * Stops a thread, invalidating it from further use
@@ -190,13 +191,10 @@ public:
190 191
191 SharedPtr<Process> owner_process; ///< Process that owns this thread 192 SharedPtr<Process> owner_process; ///< Process that owns this thread
192 193
193 /// Objects that the thread is waiting on. 194 /// Objects that the thread is waiting on, in the same order as they were
194 /// This is only populated when the thread should wait for all the objects to become ready. 195 // passed to WaitSynchronization1/N.
195 std::vector<SharedPtr<WaitObject>> wait_objects; 196 std::vector<SharedPtr<WaitObject>> wait_objects;
196 197
197 /// Mapping of Object ids to their position in the last waitlist that this object waited on.
198 boost::container::flat_map<int, s32> wait_objects_index;
199
200 VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address 198 VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address
201 199
202 /// True if the WaitSynchronizationN output parameter should be set on thread wakeup. 200 /// True if the WaitSynchronizationN output parameter should be set on thread wakeup.