]> git.corax.cc Git - corax/commitdiff
Allow forked processes to be enqueued using sched_enqueue()
authorMatthias Kruk <m@m10k.eu>
Mon, 4 Nov 2019 02:03:50 +0000 (11:03 +0900)
committerMatthias Kruk <m@m10k.eu>
Mon, 4 Nov 2019 02:03:50 +0000 (11:03 +0900)
kernel/core/sched.c

index c52d415ffe17847d7622a876c4e66ec2421480ac..e0e1f4f9fca294641b65ca6063d1fa747bb6d567 100644 (file)
@@ -150,10 +150,11 @@ int sched_enqueue(task_t *t)
 
        /*
         * Don't allow tasks to be enqueued unless they are in
-        * state TASK_STATE_NEW
+        * state TASK_STATE_NEW or TASK_STATE_FORKED
         */
 
-       if(t->t_state == TASK_STATE_NEW) {
+       if(t->t_state == TASK_STATE_NEW ||
+          t->t_state == TASK_STATE_FORKED) {
                _nq(&_readyq, t);
                ret_val = 0;
        }