diff options
author | bunnei <bunneidev@gmail.com> | 2015-01-15 01:22:50 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-01-22 00:41:00 +0100 |
commit | c22bac6398ff1705992fc44b2c29775c84cff662 (patch) | |
tree | e20da7e6e1824c19b7ced73f43815397749ffae7 /src/core/hle/kernel/kernel.h | |
parent | Merge pull request #491 from archshift/hidspvr (diff) | |
download | yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.gz yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.bz2 yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.lz yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.xz yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.zst yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.zip |
Diffstat (limited to 'src/core/hle/kernel/kernel.h')
-rw-r--r-- | src/core/hle/kernel/kernel.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 5e5217b78..a9af9de88 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -8,6 +8,8 @@ #include <array> #include <string> +#include <vector> + #include "common/common.h" #include "core/hle/result.h" @@ -92,6 +94,29 @@ inline void intrusive_ptr_release(Object* object) { template <typename T> using SharedPtr = boost::intrusive_ptr<T>; +/// Class that represents a Kernel object that a thread can be waiting on +class WaitObject : public Object { +public: + + /** + * Add a thread to wait on this object + * @param thread Pointer to thread to add + */ + void AddWaitingThread(Thread* thread); + + /** + * Resumes the next thread waiting on this object + * @return Pointer to the thread that was resumed, nullptr if no threads are waiting + */ + Thread* ResumeNextThread(); + + /// Releases all threads waiting on this object + void ReleaseAllWaitingThreads(); + +private: + std::vector<Thread*> waiting_threads; ///< Threads waiting for this object to become available +}; + /** * This class allows the creation of Handles, which are references to objects that can be tested * for validity and looked up. Here they are used to pass references to kernel objects to/from the |