diff options
author | bunnei <bunneidev@gmail.com> | 2022-01-23 06:09:45 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2022-01-23 06:09:45 +0100 |
commit | 59add00d4a37a8f7b1bc8b4c39e46fae35150540 (patch) | |
tree | 2abba7ca021ee359440de7a98fa40062a06c8e7e /src/core/hle/kernel/k_thread.cpp | |
parent | Merge pull request #7716 from german77/volume (diff) | |
download | yuzu-59add00d4a37a8f7b1bc8b4c39e46fae35150540.tar yuzu-59add00d4a37a8f7b1bc8b4c39e46fae35150540.tar.gz yuzu-59add00d4a37a8f7b1bc8b4c39e46fae35150540.tar.bz2 yuzu-59add00d4a37a8f7b1bc8b4c39e46fae35150540.tar.lz yuzu-59add00d4a37a8f7b1bc8b4c39e46fae35150540.tar.xz yuzu-59add00d4a37a8f7b1bc8b4c39e46fae35150540.tar.zst yuzu-59add00d4a37a8f7b1bc8b4c39e46fae35150540.zip |
Diffstat (limited to 'src/core/hle/kernel/k_thread.cpp')
-rw-r--r-- | src/core/hle/kernel/k_thread.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp index f42abb8a1..de3ffe0c7 100644 --- a/src/core/hle/kernel/k_thread.cpp +++ b/src/core/hle/kernel/k_thread.cpp @@ -215,7 +215,6 @@ ResultCode KThread::Initialize(KThreadFunction func, uintptr_t arg, VAddr user_s parent = owner; parent->Open(); - parent->IncrementThreadCount(); } // Initialize thread context. @@ -327,11 +326,6 @@ void KThread::Finalize() { } } - // Decrement the parent process's thread count. - if (parent != nullptr) { - parent->DecrementThreadCount(); - } - // Perform inherited finalization. KSynchronizationObject::Finalize(); } @@ -1011,7 +1005,7 @@ ResultCode KThread::Run() { if (IsUserThread() && IsSuspended()) { this->UpdateState(); } - owner->IncrementThreadCount(); + owner->IncrementRunningThreadCount(); } // Set our state and finish. @@ -1026,10 +1020,11 @@ ResultCode KThread::Run() { void KThread::Exit() { ASSERT(this == GetCurrentThreadPointer(kernel)); - // Release the thread resource hint from parent. + // Release the thread resource hint, running thread count from parent. if (parent != nullptr) { parent->GetResourceLimit()->Release(Kernel::LimitableResource::Threads, 0, 1); resource_limit_release_hint = true; + parent->DecrementRunningThreadCount(); } // Perform termination. |