Now modifying Scheduler.h or Thread.h doesnt trigger practically a full kernel rebuild. This required moving Mutex and RWLock of of line but that should be fine :^)
37 lines
685 B
C++
37 lines
685 B
C++
#pragma once
|
|
|
|
#include <BAN/Atomic.h>
|
|
#include <kernel/ProcessorID.h>
|
|
|
|
namespace Kernel
|
|
{
|
|
|
|
class Thread;
|
|
class ThreadBlocker;
|
|
|
|
struct SchedulerQueueNode
|
|
{
|
|
SchedulerQueueNode(Thread* thread)
|
|
: thread(thread)
|
|
{}
|
|
|
|
Thread* const thread;
|
|
|
|
SchedulerQueueNode* next { nullptr };
|
|
SchedulerQueueNode* prev { nullptr };
|
|
|
|
uint64_t wake_time_ns { static_cast<uint64_t>(-1) };
|
|
|
|
BAN::Atomic<ThreadBlocker*> blocker { nullptr };
|
|
SchedulerQueueNode* block_chain_prev { nullptr };
|
|
SchedulerQueueNode* block_chain_next { nullptr };
|
|
|
|
ProcessorID processor_id { PROCESSOR_NONE };
|
|
bool blocked { false };
|
|
|
|
uint64_t last_start_ns { 0 };
|
|
uint64_t time_used_ns { 0 };
|
|
};
|
|
|
|
}
|