diff options
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 63b97b74f..1b29fb3a3 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -131,8 +131,8 @@ public: | |||
| 131 | * It is used to set the output value of WaitSynchronizationN when the thread is awakened. | 131 | * It is used to set the output value of WaitSynchronizationN when the thread is awakened. |
| 132 | * @param object Object to query the index of. | 132 | * @param object Object to query the index of. |
| 133 | */ | 133 | */ |
| 134 | s32 GetWaitObjectIndex(WaitObject* object) { | 134 | s32 GetWaitObjectIndex(const WaitObject* object) const { |
| 135 | return wait_objects_index[object->GetObjectId()]; | 135 | return wait_objects_index.at(object->GetObjectId()); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | /** | 138 | /** |
| @@ -148,6 +148,15 @@ public: | |||
| 148 | return tls_address; | 148 | return tls_address; |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | /** | ||
| 152 | * Returns whether this thread is waiting for all the objects in | ||
| 153 | * its wait list to become ready, as a result of a WaitSynchronizationN call | ||
| 154 | * with wait_all = true, or a ReplyAndReceive call. | ||
| 155 | */ | ||
| 156 | bool IsWaitingAll() const { | ||
| 157 | return !wait_objects.empty(); | ||
| 158 | } | ||
| 159 | |||
| 151 | Core::ThreadContext context; | 160 | Core::ThreadContext context; |
| 152 | 161 | ||
| 153 | u32 thread_id; | 162 | u32 thread_id; |
| @@ -169,7 +178,11 @@ public: | |||
| 169 | boost::container::flat_set<SharedPtr<Mutex>> held_mutexes; | 178 | boost::container::flat_set<SharedPtr<Mutex>> held_mutexes; |
| 170 | 179 | ||
| 171 | SharedPtr<Process> owner_process; ///< Process that owns this thread | 180 | SharedPtr<Process> owner_process; ///< Process that owns this thread |
| 172 | std::vector<SharedPtr<WaitObject>> wait_objects; ///< Objects that the thread is waiting on | 181 | |
| 182 | /// Objects that the thread is waiting on. | ||
| 183 | /// This is only populated when the thread should wait for all the objects to become ready. | ||
| 184 | std::vector<SharedPtr<WaitObject>> wait_objects; | ||
| 185 | |||
| 173 | std::unordered_map<int, s32> wait_objects_index; ///< Mapping of Object ids to their position in the last waitlist that this object waited on. | 186 | std::unordered_map<int, s32> wait_objects_index; ///< Mapping of Object ids to their position in the last waitlist that this object waited on. |
| 174 | 187 | ||
| 175 | VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address | 188 | VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address |