early-access version 0032

This commit is contained in:
pineappleEA
2022-12-17 10:43:51 +01:00
parent fe6ba544c5
commit efb3a9f4b2
26 changed files with 366 additions and 103 deletions

View File

@@ -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);