X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/78cd005fac540973751b5a108c37a715bc64b5a2..7b8a1bcad75628f9add4590db2bb9b8e418ee8eb:/lunaix-os/kernel/process/sched.c diff --git a/lunaix-os/kernel/process/sched.c b/lunaix-os/kernel/process/sched.c index 4056021..bec2fae 100644 --- a/lunaix-os/kernel/process/sched.c +++ b/lunaix-os/kernel/process/sched.c @@ -42,9 +42,8 @@ sched_init() proc_pile = cake_new_pile("proc", sizeof(struct proc_info), 1, 0); cake_set_constructor(proc_pile, cake_ctor_zeroing); - sched_ctx = (struct scheduler){ ._procs = vzalloc(PROC_TABLE_SIZE), - .ptable_len = 0, - .procs_index = 0 }; + sched_ctx = (struct scheduler){ + ._procs = vzalloc(PROC_TABLE_SIZE), .ptable_len = 0, .procs_index = 0}; // TODO initialize dummy_proc sched_init_dummy(); @@ -96,6 +95,9 @@ can_schedule(struct proc_info* proc) if ((proc->state & PS_PAUSED)) { return !!(sh->sig_pending & ~1); } + if ((proc->state & PS_BLOCKED)) { + return sigset_test(sh->sig_pending, _SIGINT); + } if (sigset_test(sh->sig_pending, _SIGCONT)) { sigset_clear(sh->sig_pending, _SIGSTOP);