Add thread and process states.

Add a thread exit call.
This commit is contained in:
Drew Galbraith 2023-05-29 13:51:00 -07:00
parent 8d87791fa2
commit a06c9dced4
8 changed files with 78 additions and 9 deletions

View file

@ -47,3 +47,10 @@ void Thread::Init() {
SetRsp0(rsp0_start_);
jump_user_space(rip, rsp);
}
void Thread::Exit() {
dbgln("[%u.%u] Exiting", pid(), id_);
state_ = FINISHED;
process_->CheckState();
sched::Yield();
}