aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'extras/mini-os/sched.c')
-rw-r--r--extras/mini-os/sched.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/extras/mini-os/sched.c b/extras/mini-os/sched.c
index 69f398ed13..fbcffd463e 100644
--- a/extras/mini-os/sched.c
+++ b/extras/mini-os/sched.c
@@ -125,6 +125,14 @@ void schedule(void)
unsigned long flags;
prev = current;
local_irq_save(flags);
+ if (in_callback) {
+ printk("Must not call schedule() from a callback\n");
+ BUG();
+ }
+ if (flags) {
+ printk("Must not call schedule() with IRQs disabled\n");
+ BUG();
+ }
list_for_each(iterator, &exited_threads)
{
thread = list_entry(iterator, struct thread, thread_list);