Move preempt_forbid_cnt to a more suitable place.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 26 Aug 2008 15:28:54 +0000 (15:28 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 26 Aug 2008 15:28:54 +0000 (15:28 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1712 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/kern/proc.h
bertos/kern/signal.c

index d1525db7bd68e8be1a0ee3c2b6119c3fd342bb0c..afb9639f28b68a6c30decee00eae6f220dcc6977 100644 (file)
@@ -146,6 +146,7 @@ INLINE void proc_permit(void)
        #endif
 }
 
+extern int preempt_forbid_cnt;
 
 /**
  * Execute a block of \a CODE atomically with respect to task scheduling.
index d4fe178ed75567c21348dc72b1665eb477a608a3..948d68f1d814c687e8edb805b047da4596975242 100644 (file)
@@ -136,11 +136,13 @@ sigmask_t sig_wait(sigmask_t sigs)
 {
        sigmask_t result;
        cpuflags_t flags;
-       extern int preempt_forbid_cnt;
 
        /* Sleeping with IRQs disabled or preemption forbidden is illegal */
        IRQ_ASSERT_ENABLED();
+
+       #if CONFIG_KERN_PREEMPT
        ASSERT(preempt_forbid_cnt == 0);
+       #endif
 
        /*
         * This is subtle: there's a race condition where a concurrent