scheduler: sched_die() and new thread state

This commit is contained in:
Matheus
2022-11-20 20:13:07 -03:00
parent fcbce08dd2
commit d2c89f01e6
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -17,6 +17,7 @@
#define THREAD_STATE_RUNNING 1
#define THREAD_STATE_BLOCKED 2
#define THREAD_STATE_BLOCKED_INTR 3
#define THREAD_STATE_DEAD 4
#define PROC_STATE_NORMAL 0
#define PROC_STATE_ZOMBIE 1
+7
View File
@@ -373,6 +373,13 @@ void sched_dequeue(){
}
__attribute__((noreturn)) int sched_die(){
arch_getcls()->thread->state = THREAD_STATE_DEAD;
sched_dequeue();
}
void sched_block(bool interruptible){
thread_t* thread = arch_getcls()->thread;