From 024774c0df35faaade316607b5772090c847aac4 Mon Sep 17 00:00:00 2001 From: batt Date: Tue, 26 Aug 2008 15:28:54 +0000 Subject: [PATCH] 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 --- bertos/kern/proc.h | 1 + bertos/kern/signal.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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 -- 2.25.1