diff options
author | bunnei <bunneidev@gmail.com> | 2022-01-22 02:10:11 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2022-01-22 02:12:06 +0100 |
commit | 615fb40416b9ee10abf40a036b31d1540886a9b8 (patch) | |
tree | 8220ac1a9435933b995c4eab0e2e334daad3af11 /src/core/hle/kernel/k_thread.h | |
parent | hle: kernel: Remove redundant tracking of dummy threads. (diff) | |
download | yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.tar yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.tar.gz yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.tar.bz2 yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.tar.lz yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.tar.xz yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.tar.zst yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_thread.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h index 77b53a198..d058db62c 100644 --- a/src/core/hle/kernel/k_thread.h +++ b/src/core/hle/kernel/k_thread.h @@ -558,6 +558,10 @@ public: return thread_type; } + [[nodiscard]] bool IsDummyThread() const { + return GetThreadType() == ThreadType::Dummy; + } + void SetWaitObjectsForDebugging(const std::span<KSynchronizationObject*>& objects) { wait_objects_for_debugging.clear(); wait_objects_for_debugging.reserve(objects.size()); @@ -632,6 +636,14 @@ public: return condvar_key; } + // Dummy threads (used for HLE host threads) cannot wait based on the guest scheduler, and + // therefore will not block on guest kernel synchronization primitives. These methods handle + // blocking as needed. + + void IfDummyThreadTryWait(); + void IfDummyThreadBeginWait(); + void IfDummyThreadEndWait(); + private: static constexpr size_t PriorityInheritanceCountMax = 10; union SyncObjectBuffer { @@ -750,6 +762,7 @@ private: bool resource_limit_release_hint{}; StackParameters stack_parameters{}; KSpinLock context_guard{}; + KSpinLock dummy_wait_lock{}; // For emulation std::shared_ptr<Common::Fiber> host_context{}; |