Subject: Re: Is one allowed to call tsleep from within an interrupt context?
To: Lennart Augustsson <firstname.lastname@example.org>
From: Darren Reed <email@example.com>
Date: 09/14/1999 01:23:45
In some email I received from Lennart Augustsson, sie wrote:
> > Hmm, AFAICT there is no MI way to tell whether you are in an interrupt
> > context or not :-(.
> So then my next question is: shouldn't there be a way?
> I think it would be a great improvement if tsleep() panics
> if called from an interrupt context instead of doing something
> weird (and panic somewhere deeper down if curproc==0).
What about hard vs soft interrupts ?
What about if sometime later we have dedicated threads handling
interrupts (curproc==0 would be false) ?
Sometimes you just need to program properly and this is one of those.