kern: KWorkerTaskManager no longer tracks id

This commit is contained in:
Michael Scire 2021-09-17 16:20:55 -07:00 committed by SciresM
parent 44d10da7b8
commit 252486913b
3 changed files with 4 additions and 8 deletions

View file

@ -33,7 +33,6 @@ namespace ams::kern {
KWorkerTask *m_head_task;
KWorkerTask *m_tail_task;
KThread *m_thread;
WorkerType m_type;
bool m_active;
private:
static void ThreadFunction(uintptr_t arg);
@ -42,9 +41,9 @@ namespace ams::kern {
KWorkerTask *GetTask();
void AddTask(KWorkerTask *task);
public:
constexpr KWorkerTaskManager() : m_head_task(), m_tail_task(), m_thread(), m_type(WorkerType_Count), m_active() { /* ... */ }
constexpr KWorkerTaskManager() : m_head_task(), m_tail_task(), m_thread(), m_active() { /* ... */ }
NOINLINE void Initialize(WorkerType wt, s32 priority);
NOINLINE void Initialize(s32 priority);
static void AddTask(WorkerType type, KWorkerTask *task);
};

View file

@ -17,10 +17,7 @@
namespace ams::kern {
void KWorkerTaskManager::Initialize(WorkerType wt, s32 priority) {
/* Set type, other members already initialized in constructor. */
m_type = wt;
void KWorkerTaskManager::Initialize(s32 priority) {
/* Reserve a thread from the system limit. */
MESOSPHERE_ABORT_UNLESS(Kernel::GetSystemResourceLimit().Reserve(ams::svc::LimitableResource_ThreadCountMax, 1));

View file

@ -117,7 +117,7 @@ namespace ams::kern {
/* Perform more core-0 specific initialization. */
if (core_id == 0) {
/* Initialize the exit worker manager, so that threads and processes may exit cleanly. */
Kernel::GetWorkerTaskManager(KWorkerTaskManager::WorkerType_Exit).Initialize(KWorkerTaskManager::WorkerType_Exit, KWorkerTaskManager::ExitWorkerPriority);
Kernel::GetWorkerTaskManager(KWorkerTaskManager::WorkerType_Exit).Initialize(KWorkerTaskManager::ExitWorkerPriority);
/* Setup so that we may sleep later, and reserve memory for secure applets. */
KSystemControl::InitializePhase2();