[lkml]   [2001]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: 2.4.6 possible problem
In article <>,
Richard B. Johnson <> wrote:
> ticks = 1 * HZ; /* For 1 second */
> while((ticks = interruptible_sleep_on_timeout(&wqhead, ticks)) > 0)
> ;

Don't do this.

Imagine what happens if a signal comes in and wakes you up? The signal
will continue to be pending, which will make your "sleep loop" be a busy
loop as you can never go to sleep interruptibly with a pending signal.

In short: if you have to wait for a certain time or for a certain event,
you MUST NOT USE a interruptible sleep.

If it is ok to return early due to signals or similar (which is nice -
you can allow people to kill the process), then you use an interruptible
sleep, but then you mustn't have the above kind of loop.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:57    [W:0.055 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site