summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/process.h
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-11-14 20:13:18 -0400
committerGravatar FernandoS272019-11-21 10:46:55 -0400
commit2d16507f9fa06e868349d6f57a78585aec8628fd (patch)
tree7931e2bb9db6d55e7be760f1a1dcff14de09db78 /src/core/hle/kernel/process.h
parentMerge pull request #3142 from ReinUsesLisp/depbar-log (diff)
downloadyuzu-2d16507f9fa06e868349d6f57a78585aec8628fd.tar.gz
yuzu-2d16507f9fa06e868349d6f57a78585aec8628fd.tar.xz
yuzu-2d16507f9fa06e868349d6f57a78585aec8628fd.zip
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.
Diffstat (limited to 'src/core/hle/kernel/process.h')
-rw-r--r--src/core/hle/kernel/process.h12
1 files changed, 12 insertions, 0 deletions
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:
232 return thread_list; 232 return thread_list;
233 } 233 }
234 234
235 /// Insert a thread into the condition variable wait container
236 void InsertConditionVariableThread(SharedPtr<Thread> thread);
237
238 /// Remove a thread from the condition variable wait container
239 void RemoveConditionVariableThread(SharedPtr<Thread> thread);
240
241 /// Obtain all condition variable threads waiting for some address
242 std::vector<SharedPtr<Thread>> GetConditionVariableThreads(VAddr cond_var_addr);
243
235 /// Registers a thread as being created under this process, 244 /// Registers a thread as being created under this process,
236 /// adding it to this process' thread list. 245 /// adding it to this process' thread list.
237 void RegisterThread(const Thread* thread); 246 void RegisterThread(const Thread* thread);
@@ -375,6 +384,9 @@ private:
375 /// List of threads that are running with this process as their owner. 384 /// List of threads that are running with this process as their owner.
376 std::list<const Thread*> thread_list; 385 std::list<const Thread*> thread_list;
377 386
387 /// List of threads waiting for a condition variable
388 std::list<SharedPtr<Thread>> cond_var_threads;
389
378 /// System context 390 /// System context
379 Core::System& system; 391 Core::System& system;
380 392