proc_new(): thinko: add new processes to the ready list also in the preempt case
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 18 Aug 2008 16:54:41 +0000 (16:54 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 18 Aug 2008 16:54:41 +0000 (16:54 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1661 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/kern/proc.c

index d4f980af12a244547043a3bf49bcfb9b9facbe19..16e171de9d65e2d94fd74bda5032230c27745709 100644 (file)
@@ -218,13 +218,13 @@ struct Process *proc_new_with_name(UNUSED(const char *, name), void (*entry)(voi
                /* Push a clean set of CPU registers for asm_switch_context() */
                for (i = 0; i < CPU_SAVED_REGS_CNT; i++)
                        CPU_PUSH_WORD(proc->stack, CPU_REG_INIT_VALUE(i));
-
-               /* Add to ready list */
-               ATOMIC(SCHED_ENQUEUE(proc));
-               ATOMIC(LIST_ASSERT_VALID(&ProcReadyList));
        }
        #endif // CONFIG_KERN_PREEMPT
 
+       /* Add to ready list */
+       ATOMIC(SCHED_ENQUEUE(proc));
+       ATOMIC(LIST_ASSERT_VALID(&ProcReadyList));
+
        #if CONFIG_KERN_MONITOR
                monitor_add(proc, name);
        #endif