summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_process.cpp
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2022-12-15 20:22:07 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2022-12-15 20:44:21 +0100
commitdca4f0687a82b75382df9bf04a3f76c4afab56e2 (patch)
tree63cd36538d78b715a027dfb2ebb676735d130a4d /src/core/hle/kernel/k_process.cpp
parentMerge pull request #9433 from Tachi107/cmake-is-awful (diff)
downloadyuzu-dca4f0687a82b75382df9bf04a3f76c4afab56e2.tar
yuzu-dca4f0687a82b75382df9bf04a3f76c4afab56e2.tar.gz
yuzu-dca4f0687a82b75382df9bf04a3f76c4afab56e2.tar.bz2
yuzu-dca4f0687a82b75382df9bf04a3f76c4afab56e2.tar.lz
yuzu-dca4f0687a82b75382df9bf04a3f76c4afab56e2.tar.xz
yuzu-dca4f0687a82b75382df9bf04a3f76c4afab56e2.tar.zst
yuzu-dca4f0687a82b75382df9bf04a3f76c4afab56e2.zip
Diffstat (limited to 'src/core/hle/kernel/k_process.cpp')
-rw-r--r--src/core/hle/kernel/k_process.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp
index d1dc62401..a1abf5d68 100644
--- a/src/core/hle/kernel/k_process.cpp
+++ b/src/core/hle/kernel/k_process.cpp
@@ -285,6 +285,17 @@ void KProcess::UnregisterThread(KThread* thread) {
thread_list.remove(thread);
}
+u64 KProcess::GetFreeThreadCount() const {
+ if (resource_limit != nullptr) {
+ const auto current_value =
+ resource_limit->GetCurrentValue(LimitableResource::ThreadCountMax);
+ const auto limit_value = resource_limit->GetLimitValue(LimitableResource::ThreadCountMax);
+ return limit_value - current_value;
+ } else {
+ return 0;
+ }
+}
+
Result KProcess::Reset() {
// Lock the process and the scheduler.
KScopedLightLock lk(state_lock);