mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-27 15:04:33 +00:00
Add GetThread() function to PCB class
This commit is contained in:
parent
2274089a1c
commit
ab8ca388bb
@ -473,6 +473,7 @@ namespace Tasking
|
||||
void SetWorkingDirectory(Node *node);
|
||||
void SetExe(const char *path);
|
||||
size_t GetSize();
|
||||
TCB *GetThread(TID ID);
|
||||
|
||||
PCB(class Task *ctx,
|
||||
PCB *Parent,
|
||||
|
@ -48,6 +48,14 @@ using namespace vfs;
|
||||
|
||||
namespace Tasking
|
||||
{
|
||||
TCB *PCB::GetThread(TID ID)
|
||||
{
|
||||
auto it = std::find_if(this->Threads.begin(), this->Threads.end(),
|
||||
[ID](TCB *t)
|
||||
{ return t->ID == ID; });
|
||||
return it != this->Threads.end() ? *it : nullptr;
|
||||
}
|
||||
|
||||
int PCB::SendSignal(int sig)
|
||||
{
|
||||
return this->Signals->SendSignal(sig);
|
||||
|
Loading…
x
Reference in New Issue
Block a user