Move process be to RefCounted

This commit is contained in:
Drew Galbraith 2023-06-06 19:12:46 -07:00
parent 2e1357255c
commit d358c1d672
6 changed files with 16 additions and 11 deletions

View file

@ -13,13 +13,14 @@ static uint64_t gNextId = 1;
}
SharedPtr<Process> Process::RootProcess() {
SharedPtr<Process> proc(new Process(0));
RefPtr<Process> Process::RootProcess() {
RefPtr<Process> proc = MakeRefCounted<Process>(0);
proc->threads_.PushBack(Thread::RootThread(*proc));
proc->next_thread_id_ = 1;
return proc;
}
RefPtr<Process> Process::Create() { return MakeRefCounted<Process>(); }
Process::Process() : id_(gNextId++), state_(RUNNING) {
caps_.PushBack(new Capability(this, Capability::PROCESS, Z_INIT_PROC_SELF,