[Zion] Add a proc/thread cleanup thread for future use.
This commit is contained in:
parent
8e4cd1562f
commit
cb590c96b8
9 changed files with 95 additions and 0 deletions
25
zion/scheduler/cleanup.h
Normal file
25
zion/scheduler/cleanup.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#pragma once
|
||||
|
||||
#include <glacier/container/linked_list.h>
|
||||
#include <glacier/memory/ref_ptr.h>
|
||||
|
||||
#include "object/process.h"
|
||||
#include "object/semaphore.h"
|
||||
#include "object/thread.h"
|
||||
|
||||
class ProcessCleanup {
|
||||
public:
|
||||
ProcessCleanup() {}
|
||||
|
||||
void CleanupLoop();
|
||||
|
||||
void CleanupProcess(glcr::RefPtr<Process> process);
|
||||
void CleanupThread(glcr::RefPtr<Thread> thread);
|
||||
|
||||
private:
|
||||
Semaphore semaphore_;
|
||||
glcr::LinkedList<glcr::RefPtr<Thread>> thread_list_;
|
||||
glcr::LinkedList<glcr::RefPtr<Process>> process_list_;
|
||||
};
|
||||
|
||||
void CleanupThreadEntry(ProcessCleanup* cleanup);
|
||||
Loading…
Add table
Add a link
Reference in a new issue