From: batt Date: Tue, 26 Aug 2008 15:28:54 +0000 (+0000) Subject: Move preempt_forbid_cnt to a more suitable place. X-Git-Tag: 2.0.0~222 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=024774c0df35faaade316607b5772090c847aac4;p=bertos.git Move preempt_forbid_cnt to a more suitable place. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1712 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/kern/proc.h b/bertos/kern/proc.h index d1525db7..afb9639f 100644 --- a/bertos/kern/proc.h +++ b/bertos/kern/proc.h @@ -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. diff --git a/bertos/kern/signal.c b/bertos/kern/signal.c index d4fe178e..948d68f1 100644 --- a/bertos/kern/signal.c +++ b/bertos/kern/signal.c @@ -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