summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/thread.h
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-09-28 18:53:32 +0200
committerSubv <subv2112@gmail.com>2017-09-28 18:53:32 +0200
commit8432749db7afecc9beea20f993cc036418caaa15 (patch)
tree10dd3fcd755bd7bdc27eef120885c7e700ab4288 /src/core/hle/kernel/thread.h
parentMerge pull request #2907 from Subv/warnings3 (diff)
downloadyuzu-8432749db7afecc9beea20f993cc036418caaa15.tar
yuzu-8432749db7afecc9beea20f993cc036418caaa15.tar.gz
yuzu-8432749db7afecc9beea20f993cc036418caaa15.tar.bz2
yuzu-8432749db7afecc9beea20f993cc036418caaa15.tar.lz
yuzu-8432749db7afecc9beea20f993cc036418caaa15.tar.xz
yuzu-8432749db7afecc9beea20f993cc036418caaa15.tar.zst
yuzu-8432749db7afecc9beea20f993cc036418caaa15.zip
Diffstat (limited to 'src/core/hle/kernel/thread.h')
-rw-r--r--src/core/hle/kernel/thread.h15
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 {
THREADSTATUS_DEAD ///< Run to completion, or forcefully terminated
};
+enum class ThreadWakeupReason {
+ Signal, // The thread was woken up by WakeupAllWaitingThreads due to an object signal.
+ Timeout // The thread was woken up due to a wait timeout.
+};
+
namespace Kernel {
class Mutex;
@@ -197,14 +202,18 @@ public:
VAddr wait_address; ///< If waiting on an AddressArbiter, this is the arbitration address
- /// True if the WaitSynchronizationN output parameter should be set on thread wakeup.
- bool wait_set_output;
-
std::string name;
/// Handle used as userdata to reference this object when inserting into the CoreTiming queue.
Handle callback_handle;
+ using WakeupCallback = void(ThreadWakeupReason reason, SharedPtr<Thread> thread,
+ SharedPtr<WaitObject> object);
+ // Callback that will be invoked when the thread is resumed from a waiting state. If the thread
+ // was waiting via WaitSynchronizationN then the object will be the last object that became
+ // available. In case of a timeout, the object will be nullptr.
+ std::function<WakeupCallback> wakeup_callback;
+
private:
Thread();
~Thread() override;