Add a ProcessManager class to store Process objects.
Trying out a new method for exposing global objects directly via a variable.
This commit is contained in:
parent
b58186265e
commit
7fe6c24aa5
7 changed files with 66 additions and 23 deletions
23
zion/scheduler/process_manager.h
Normal file
23
zion/scheduler/process_manager.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include "lib/linked_list.h"
|
||||
#include "lib/shared_ptr.h"
|
||||
#include "scheduler/process.h"
|
||||
|
||||
class ProcessManager {
|
||||
public:
|
||||
// Initializes the ProcessManager
|
||||
// and stores it in the global variable.
|
||||
static void Init();
|
||||
|
||||
void InsertProcess(const SharedPtr<Process>& proc);
|
||||
Process& FromId(uint64_t id);
|
||||
|
||||
void DumpProcessStates();
|
||||
|
||||
private:
|
||||
// TODO: This should be a hashmap.
|
||||
LinkedList<SharedPtr<Process>> proc_list_;
|
||||
};
|
||||
|
||||
extern ProcessManager* gProcMan;
|
||||
Loading…
Add table
Add a link
Reference in a new issue