kern: devirtualize KReadableEvent::Reset, KWorkerTask::DoWorkerTask

This commit is contained in:
Michael Scire
2021-10-24 20:41:38 -07:00
parent fd187f952e
commit 54dde406bc
12 changed files with 62 additions and 24 deletions

View File

@@ -41,6 +41,17 @@ namespace ams::kern {
}
void KWorkerTask::DoWorkerTask() {
if (auto * const thread = this->DynamicCast<KThread *>(); thread != nullptr) {
return thread->DoWorkerTaskImpl();
} else {
auto * const process = this->DynamicCast<KProcess *>();
MESOSPHERE_ABORT_UNLESS(process != nullptr);
return process->DoWorkerTaskImpl();
}
}
void KWorkerTaskManager::Initialize(s32 priority) {
/* Reserve a thread from the system limit. */
MESOSPHERE_ABORT_UNLESS(Kernel::GetSystemResourceLimit().Reserve(ams::svc::LimitableResource_ThreadCountMax, 1));