mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 07:05:46 +00:00
kernel: process: Implement GetFreeThreadCount
Used by Just Dance® 2023 Edition
This commit is contained in:
parent
630b1dcd85
commit
464b7a9ee2
3 changed files with 28 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue