2023-05-29 23:35:44 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "lib/linked_list.h"
|
2023-06-06 19:12:46 -07:00
|
|
|
#include "lib/ref_ptr.h"
|
2023-06-06 20:18:53 -07:00
|
|
|
#include "object/process.h"
|
2023-05-29 23:35:44 -07:00
|
|
|
|
|
|
|
class ProcessManager {
|
|
|
|
public:
|
|
|
|
// Initializes the ProcessManager
|
|
|
|
// and stores it in the global variable.
|
|
|
|
static void Init();
|
|
|
|
|
2023-06-06 19:12:46 -07:00
|
|
|
void InsertProcess(const RefPtr<Process>& proc);
|
2023-05-29 23:35:44 -07:00
|
|
|
Process& FromId(uint64_t id);
|
|
|
|
|
|
|
|
void DumpProcessStates();
|
|
|
|
|
|
|
|
private:
|
|
|
|
// TODO: This should be a hashmap.
|
2023-06-06 19:12:46 -07:00
|
|
|
LinkedList<RefPtr<Process>> proc_list_;
|
2023-05-29 23:35:44 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
extern ProcessManager* gProcMan;
|