preempt: be sure to never call proc_switch() or proc_yield() with IRQs disabled.
authorarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 17 Mar 2010 14:12:58 +0000 (14:12 +0000)
committerarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 17 Mar 2010 14:12:58 +0000 (14:12 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3228 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/kern/preempt.c

index 19c43d3c0c01da72d468cf9752faceddf44ad8c5..3037c15cc47f4258fb342e896b15c3937d054cbb 100644 (file)
@@ -203,6 +203,7 @@ void proc_preempt(void)
 void proc_switch(void)
 {
        ASSERT(proc_preemptAllowed());
+       IRQ_ASSERT_ENABLED();
 
        ATOMIC(proc_schedule());
 }
@@ -219,6 +220,7 @@ void proc_yield(void)
         * ASSERT if it happens.
         */
        ASSERT(proc_preemptAllowed());
+       IRQ_ASSERT_ENABLED();
 
        ATOMIC(
                SCHED_ENQUEUE(current_process);