From 2d16507f9fa06e868349d6f57a78585aec8628fd Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Thu, 14 Nov 2019 20:13:18 -0400 Subject: Kernel: Correct behavior of Condition Variables to be more similar to real hardware. This commit ensures cond var threads act exactly as they do in the real console. The original implementation uses an RBTree and the behavior of cond var threads is that at the same priority level they act like a FIFO. --- src/core/hle/kernel/process.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/core/hle/kernel/process.h') diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index c2df451f3..e8bff709b 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -232,6 +232,15 @@ public: return thread_list; } + /// Insert a thread into the condition variable wait container + void InsertConditionVariableThread(SharedPtr thread); + + /// Remove a thread from the condition variable wait container + void RemoveConditionVariableThread(SharedPtr thread); + + /// Obtain all condition variable threads waiting for some address + std::vector> GetConditionVariableThreads(VAddr cond_var_addr); + /// Registers a thread as being created under this process, /// adding it to this process' thread list. void RegisterThread(const Thread* thread); @@ -375,6 +384,9 @@ private: /// List of threads that are running with this process as their owner. std::list thread_list; + /// List of threads waiting for a condition variable + std::list> cond_var_threads; + /// System context Core::System& system; -- cgit v1.2.3