acadia/zion/scheduler/process_manager.h

31 lines
654 B
C
Raw Permalink Normal View History

#pragma once
2023-06-26 15:46:03 -07:00
#include <glacier/container/vector.h>
2023-06-21 15:07:40 -07:00
#include <glacier/memory/ref_ptr.h>
#include "object/process.h"
#include "scheduler/cleanup.h"
class ProcessManager {
public:
// Initializes the ProcessManager
// and stores it in the global variable.
static void Init();
2023-06-21 15:07:40 -07:00
void InsertProcess(const glcr::RefPtr<Process>& proc);
void RemoveProcess(uint64_t id);
Process& FromId(uint64_t id);
void InitCleanup();
void CleanupProcess(uint64_t pid);
void CleanupThread(glcr::RefPtr<Thread> thread);
private:
glcr::HashMap<uint64_t, glcr::RefPtr<Process>> proc_map_;
ProcessCleanup cleanup;
};
extern ProcessManager* gProcMan;