mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
scheduler: sched_die() and new thread state
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user