mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-10 23:09:18 +00:00
Revise PID and TID generation to align with standards
This commit is contained in:
@ -155,15 +155,12 @@ namespace Tasking::Scheduler
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TCB *Custom::GetThreadByID(TID ID)
|
||||
TCB *Custom::GetThreadByID(TID ID, PCB *Parent)
|
||||
{
|
||||
foreach (auto p in ProcessList)
|
||||
foreach (auto t in Parent->Threads)
|
||||
{
|
||||
foreach (auto t in p->Threads)
|
||||
{
|
||||
if (t->ID == ID)
|
||||
return t;
|
||||
}
|
||||
if (t->ID == ID)
|
||||
return t;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -62,9 +62,9 @@ namespace Tasking
|
||||
return ((Scheduler::Base *)Scheduler)->GetProcessByID(ID);
|
||||
}
|
||||
|
||||
TCB *Task::GetThreadByID(TID ID)
|
||||
TCB *Task::GetThreadByID(TID ID, PCB* Parent)
|
||||
{
|
||||
return ((Scheduler::Base *)Scheduler)->GetThreadByID(ID);
|
||||
return ((Scheduler::Base *)Scheduler)->GetThreadByID(ID, Parent);
|
||||
}
|
||||
|
||||
std::list<PCB *> Task::GetProcessList()
|
||||
|
@ -426,7 +426,7 @@ namespace Tasking
|
||||
this->Parent = Parent;
|
||||
|
||||
this->ctx = ctx;
|
||||
this->ID = ctx->NextTID++;
|
||||
this->ID = (TID)this->Parent->ID + (TID)this->Parent->Threads.size();
|
||||
|
||||
if (this->Name)
|
||||
delete[] this->Name;
|
||||
|
Reference in New Issue
Block a user