kern: split Process/Thread exit to separate WorkerTaskManagers

This commit is contained in:
Michael Scire 2023-10-11 09:57:58 -07:00 committed by SciresM
parent 4ddfb6183c
commit f93aea4c06
4 changed files with 15 additions and 10 deletions

View file

@ -476,10 +476,6 @@ namespace ams::kern {
m_parent->ClearRunningThread(this);
}
/* Signal. */
m_signaled = true;
KSynchronizationObject::NotifyAvailable();
/* Call the on thread termination handler. */
KThreadContext::OnThreadTerminating(this);
@ -507,6 +503,13 @@ namespace ams::kern {
cpu::SynchronizeCores(m_parent->GetPhysicalCoreMask());
}
/* Acquire the scheduler lock. */
KScopedSchedulerLock sl;
/* Signal. */
m_signaled = true;
KSynchronizationObject::NotifyAvailable();
/* Close the thread. */
this->Close();
}
@ -1328,7 +1331,7 @@ namespace ams::kern {
this->StartTermination();
/* Register the thread as a work task. */
KWorkerTaskManager::AddTask(KWorkerTaskManager::WorkerType_Exit, this);
KWorkerTaskManager::AddTask(KWorkerTaskManager::WorkerType_ExitThread, this);
}
MESOSPHERE_PANIC("KThread::Exit() would return");