Added last task ticks counter

This commit is contained in:
Alex
2023-02-27 17:44:10 +02:00
parent c4a2f645de
commit df24131e48
4 changed files with 16 additions and 1 deletions

View File

@ -230,6 +230,7 @@ namespace Tasking
PCB *IdleProcess = nullptr;
TCB *IdleThread = nullptr;
Atomic<uint64_t> SchedulerTicks = 0;
Atomic<uint64_t> LastTaskTicks = 0;
bool InvalidPCB(PCB *pcb);
bool InvalidTCB(TCB *tcb);
@ -263,6 +264,7 @@ namespace Tasking
public:
uint64_t GetSchedulerTicks() { return SchedulerTicks.Load(); }
uint64_t GetLastTaskTicks() { return LastTaskTicks.Load(); }
Vector<PCB *> GetProcessList() { return ListProcess; }
Security *GetSecurityManager() { return &SecurityManager; }
void Panic() { StopScheduler = true; }

View File

@ -86,6 +86,18 @@ public:
VectorSize--;
}
__no_instrument_function void remove(const T &Value)
{
for (size_t i = 0; i < VectorSize; i++)
{
if (VectorBuffer[i] == Value)
{
remove(i);
return;
}
}
}
__no_instrument_function size_t capacity() const { return VectorCapacity; }
__no_instrument_function size_t size() const { return VectorSize; }