summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.h
diff options
context:
space:
mode:
authorGravatar Subv2018-01-08 11:35:03 -0500
committerGravatar bunnei2018-01-08 21:12:49 -0500
commit2a3f8e8484fca54767c9874cc21f5985d2be1463 (patch)
tree0976e02e0b495f07b11a51811618199d791d4c4e /src/core/hle/kernel/thread.h
parentcmake: Use LIBUNICORN_* on Windows. (diff)
downloadyuzu-2a3f8e8484fca54767c9874cc21f5985d2be1463.tar.gz
yuzu-2a3f8e8484fca54767c9874cc21f5985d2be1463.tar.xz
yuzu-2a3f8e8484fca54767c9874cc21f5985d2be1463.zip
Kernel: Allow chaining WaitSynchronization calls inside a wakeup callback.
Diffstat (limited to 'src/core/hle/kernel/thread.h')
-rw-r--r--src/core/hle/kernel/thread.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index ed44ee933..19ba6e0af 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -128,6 +128,9 @@ public:
128 */ 128 */
129 void WakeAfterDelay(s64 nanoseconds); 129 void WakeAfterDelay(s64 nanoseconds);
130 130
131 /// Cancel any outstanding wakeup events for this thread
132 void CancelWakeupTimer();
133
131 /** 134 /**
132 * Sets the result after the thread awakens (from either WaitSynchronization SVC) 135 * Sets the result after the thread awakens (from either WaitSynchronization SVC)
133 * @param result Value to set to the returned result 136 * @param result Value to set to the returned result
@@ -218,8 +221,8 @@ public:
218 /// Handle used as userdata to reference this object when inserting into the CoreTiming queue. 221 /// Handle used as userdata to reference this object when inserting into the CoreTiming queue.
219 Handle callback_handle; 222 Handle callback_handle;
220 223
221 using WakeupCallback = void(ThreadWakeupReason reason, SharedPtr<Thread> thread, 224 using WakeupCallback = bool(ThreadWakeupReason reason, SharedPtr<Thread> thread,
222 SharedPtr<WaitObject> object); 225 SharedPtr<WaitObject> object, size_t index);
223 // Callback that will be invoked when the thread is resumed from a waiting state. If the thread 226 // Callback that will be invoked when the thread is resumed from a waiting state. If the thread
224 // was waiting via WaitSynchronizationN then the object will be the last object that became 227 // was waiting via WaitSynchronizationN then the object will be the last object that became
225 // available. In case of a timeout, the object will be nullptr. 228 // available. In case of a timeout, the object will be nullptr.
@@ -237,7 +240,8 @@ private:
237 * @param owner_process The parent process for the main thread 240 * @param owner_process The parent process for the main thread
238 * @return A shared pointer to the main thread 241 * @return A shared pointer to the main thread
239 */ 242 */
240SharedPtr<Thread> SetupMainThread(VAddr entry_point, u32 priority, SharedPtr<Process> owner_process); 243SharedPtr<Thread> SetupMainThread(VAddr entry_point, u32 priority,
244 SharedPtr<Process> owner_process);
241 245
242/** 246/**
243 * Returns whether there are any threads that are ready to run. 247 * Returns whether there are any threads that are ready to run.