add a function that gets called after every system call and make all threads quit on program exit

This commit is contained in:
Matheus
2022-12-25 15:46:37 -03:00
parent 0cf4287719
commit 7e975a3837
5 changed files with 53 additions and 11 deletions
+6
View File
@@ -380,6 +380,12 @@ __attribute__((noreturn)) int sched_die(){
sched_dequeue();
}
void sched_threadexitcheck(){
if(arch_getcls()->thread->shouldexit)
sched_die();
}
void sched_block(bool interruptible){
thread_t* thread = arch_getcls()->thread;