CM3: kernel preemption.
[bertos.git] / bertos / kern / preempt.c
index 1cb5e5a07f88d61f1989888855d3d8425eadb64c..4b5e66c3d2261b67874b645c79e0351f7e8d1805 100644 (file)
@@ -142,6 +142,8 @@ int preempt_needPreempt(void)
                return 0;
        if (!proc_preemptAllowed())
                return 0;
+       if (LIST_EMPTY(&proc_ready_list))
+               return 0;
        return _proc_quantum ? prio_next() > prio_curr() :
                        prio_next() >= prio_curr();
 }