Re: down_interruptible and timers

Tim Waugh (tim@cyberelk.demon.co.uk)
Mon, 25 Jan 1999 23:17:54 +0000 (GMT)


On Mon, 25 Jan 1999, MOLNAR Ingo wrote:

> i think here is your problem. You've returned from down_interruptible
> without having a signal, this means you _got_ the semaphore. In this case
> you should not do the 'goto false_alarm' because you will down() forever.

Yes, I know that's true _now_. It wasn't before. I'm not using the
semaphore like a mutex; I'm trying to use it like a semaphore.

It's all very well having recursive muteces, but I don't see how recursive
semaphores - used like semaphores - make sense.

All I want is a primitive that I can use to count and wait for events.
Semaphores used to do that, before they became recursive. Now my code is
broken, and I'm not sure what the correct fix is.

> also, you say the timer wakes you up, but only if everything is OK. You
> should rather have a timer for the case that the hardware doesnt respond,
> this will then up() your process, and the process might retry 5 times if
> the hardware is not yet OK.

Yes, that is what is supposed to happen, and what used to happen.

How would you modify the code so that it works again?

Tim.
*/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/