Add Scheduler wireframe.

Right now does nothing but has containing classes for process and thread
information.
This commit is contained in:
Drew Galbraith 2023-05-18 12:43:53 -07:00
parent de2c96b848
commit 960cbf9519
8 changed files with 208 additions and 1 deletions

23
zion/scheduler/thread.h Normal file
View file

@ -0,0 +1,23 @@
#pragma once
#include <stdint.h>
// Forward decl due to cyclic dependency.
class Process;
class Thread {
public:
Thread(Process* proc, uint64_t thread_id) : process_(proc), id_(thread_id) {}
uint64_t tid() { return id_; };
uint64_t pid();
Process& process() { return *process_; }
private:
Process* process_;
uint64_t id_;
// Next task in queue for quick scheduling.
Thread* next_task_;
};