diff options
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 6a3566f15..328f1a86a 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -41,6 +41,11 @@ enum ThreadStatus { | |||
| 41 | THREADSTATUS_DEAD ///< Run to completion, or forcefully terminated | 41 | THREADSTATUS_DEAD ///< Run to completion, or forcefully terminated |
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | enum class ThreadWakeupReason { | ||
| 45 | Signal, // The thread was woken up by WakeupAllWaitingThreads due to an object signal. | ||
| 46 | Timeout // The thread was woken up due to a wait timeout. | ||
| 47 | }; | ||
| 48 | |||
| 44 | namespace Kernel { | 49 | namespace Kernel { |
| 45 | 50 | ||
| 46 | class Mutex; | 51 | class Mutex; |
| @@ -197,14 +202,18 @@ public: | |||
| 197 | 202 | ||
| 198 | VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address | 203 | VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address |
| 199 | 204 | ||
| 200 | /// True if the WaitSynchronizationN output parameter should be set on thread wakeup. | ||
| 201 | bool wait_set_output; | ||
| 202 | |||
| 203 | std::string name; | 205 | std::string name; |
| 204 | 206 | ||
| 205 | /// Handle used as userdata to reference this object when inserting into the CoreTiming queue. | 207 | /// Handle used as userdata to reference this object when inserting into the CoreTiming queue. |
| 206 | Handle callback_handle; | 208 | Handle callback_handle; |
| 207 | 209 | ||
| 210 | using WakeupCallback = void(ThreadWakeupReason reason, SharedPtr<Thread> thread, | ||
| 211 | SharedPtr<WaitObject> object); | ||
| 212 | // Callback that will be invoked when the thread is resumed from a waiting state. If the thread | ||
| 213 | // was waiting via WaitSynchronizationN then the object will be the last object that became | ||
| 214 | // available. In case of a timeout, the object will be nullptr. | ||
| 215 | std::function<WakeupCallback> wakeup_callback; | ||
| 216 | |||
| 208 | private: | 217 | private: |
| 209 | Thread(); | 218 | Thread(); |
| 210 | ~Thread() override; | 219 | ~Thread() override; |