Re: [ANNOUNCE] Kernel Janitor's TODO list

Daniel Phillips (phillips@innominate.de)
Wed, 31 Jan 2001 01:06:08 +0100


Timur Tabi wrote:
>
> ** Reply to message from David Woodhouse
>
> > Note that this is _precisely_ the reason I'm advocating the removal of
> > sleep_on(). When I was young and stupid (ok, "younger and stupider") I used
> > sleep_on() in my code. I pondered briefly the fact that I really couldn't
> > convince myself that it was safe, but because it was used in so many other
> > places, I decided I had to be missing something, and used it anyway.
> >
> > I was wrong. I was copying broken code. And now I want to remove all those
> > bad examples - for the benefit of those who are looking at them now and are
> > tempted to copy them.
>
> What is wrong with sleep_on()?

If you have a task that looks like:

loop:
<do something important>
sleep_on(q)

And you do wakeup(q) hoping to get something important done, then if the
task isn't sleeping at the time of the wakeup it will ignore the wakeup
and go to sleep, which imay not be what you wanted.

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