From 1f9a4aef45e0bf55a31bf88a828ebd867cf32a34 Mon Sep 17 00:00:00 2001 From: bernie Date: Sun, 3 Oct 2004 18:48:01 +0000 Subject: [PATCH] timer_delay(): Add a sanity check to avoid sleeping forever. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@227 38d2e660-2303-0410-9eaa-f027e97ec537 --- drv/timer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drv/timer.c b/drv/timer.c index c9c66832..c347deb5 100755 --- a/drv/timer.c +++ b/drv/timer.c @@ -15,6 +15,9 @@ /*#* *#* $Log$ + *#* Revision 1.16 2004/10/03 18:48:01 bernie + *#* timer_delay(): Add a sanity check to avoid sleeping forever. + *#* *#* Revision 1.15 2004/09/14 21:07:18 bernie *#* Use debug.h instead of kdebug.h. *#* @@ -139,6 +142,11 @@ Timer *timer_abort(Timer *timer) */ void timer_delay(time_t time) { +#if defined(IRQ_GETSTATE) + /* We shouldn't sleep with interrupts disabled */ + ASSERT(IRQ_GETSTATE()); +#endif + #if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS Timer t; -- 2.25.1