Revise PID and TID generation to align with standards

This commit is contained in:
EnderIce2
2024-03-02 00:51:06 +02:00
parent 525a102f20
commit d3a16469ad
9 changed files with 27 additions and 20 deletions

View File

@ -114,7 +114,8 @@ void KernelMainThread()
KPrint("Executing %s", Config.InitPath);
int ExitCode = -1;
Tasking::TCB *initThread = nullptr;
Tasking::TCB *initThread;
Tasking::PCB *initProc;
int tid = SpawnInit();
if (tid < 0)
{
@ -127,7 +128,8 @@ void KernelMainThread()
Config.InitPath);
thisThread->SetPriority(Tasking::Idle);
initThread = TaskManager->GetThreadByID(tid);
initProc = TaskManager->GetProcessByID(tid);
initThread = TaskManager->GetThreadByID(tid, initProc);
TaskManager->WaitForThread(initThread);
ExitCode = initThread->GetExitCode();
Exit: