mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Improved checks for WakeUpThreads
This commit is contained in:
parent
0ac4fa3e14
commit
f07c10a2ee
@ -359,15 +359,8 @@ namespace Tasking
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Check process status.
|
// Check process status.
|
||||||
switch (pcb->Status)
|
if (pcb->Status == TaskStatus::Terminated)
|
||||||
{
|
|
||||||
case TaskStatus::Ready:
|
|
||||||
schedbg("Ready process (%s)%d", pcb->Name, pcb->ID);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
schedbg("Process \"%s\"(%d) status %d", pcb->Name, pcb->ID, pcb->Status);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
// Loop through all the threads.
|
// Loop through all the threads.
|
||||||
foreach (TCB *tcb in pcb->Threads)
|
foreach (TCB *tcb in pcb->Threads)
|
||||||
@ -376,7 +369,7 @@ namespace Tasking
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Check if the thread is sleeping.
|
// Check if the thread is sleeping.
|
||||||
if (tcb->Status != TaskStatus::Sleeping)
|
if (tcb->Status != TaskStatus::Sleeping || pcb->Status == TaskStatus::Terminated)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Check if the thread is ready to wake up.
|
// Check if the thread is ready to wake up.
|
||||||
@ -451,7 +444,7 @@ namespace Tasking
|
|||||||
CurrentCPU->CurrentThread->Status = TaskStatus::Ready;
|
CurrentCPU->CurrentThread->Status = TaskStatus::Ready;
|
||||||
|
|
||||||
// Loop through all threads and find which one is ready.
|
// Loop through all threads and find which one is ready.
|
||||||
WakeUpThreads(CurrentCPU);
|
this->WakeUpThreads(CurrentCPU);
|
||||||
|
|
||||||
// Get next available thread from the list.
|
// Get next available thread from the list.
|
||||||
if (this->GetNextAvailableThread(CurrentCPU))
|
if (this->GetNextAvailableThread(CurrentCPU))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user