Re: [patch] sleep_on() done with cli(), NetROM, 2.2.2

Linus Torvalds (torvalds@transmeta.com)
Tue, 2 Mar 1999 12:31:01 -0800 (PST)


On Tue, 2 Mar 1999, Ingo Molnar wrote:
>
> i've attached a draft 'waiting for events' framework, and i've converted
> printk.c to the 'new' usage. This now is both raceless and doesnt lock up
> on SMP. The user-visible interface is:
>
> wait_event(wq, condition);
> or
> wait_async_event(wq, condition);
> or
> error = wait_event_interruptible(wq, condition);
> or
> error = wait_async_event_interruptible(wq, condition);

No, you can't do it this way.

"condition" has to be _recalculated_ at each point - there's no point
sending in a stale condition to the routine, as it has to be recalculated
after yoiu've added yourself to the wait-queues.

Linus

-
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/