From: bernie Date: Sun, 3 Oct 2004 18:48:01 +0000 (+0000) Subject: timer_delay(): Add a sanity check to avoid sleeping forever. X-Git-Tag: 1.0.0~1014 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=1f9a4aef45e0bf55a31bf88a828ebd867cf32a34;hp=535ea9493469c32f7cb842be84defa15bac8550b;p=bertos.git 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 --- 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;