lkml.org 
[lkml]   [2004]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: missing wait_event_timeout
From
Date
Maybe it is just safer to call wait_event with the timeout check as one
of the conditions?

On Tue, 2004-08-24 at 16:31, Steve French wrote:
> Is there a reason why there is no wait_event_timeout function in kernel.
> There is only the __wait_event_timeout_interruptible in wait.h
> It seems the easiest way to fix the few remaining pieces of code which
> call the deprecated sleep_on_timeout.
>
> ie something like:
>
>
> > #define __wait_event_timeout(wq, condition, ret)
> > do {
> > DEFINE_WAIT(__wait);
> >
> > for (;;) {
> > prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE);
> > if (condition)
> > break;
> > ret = schedule_timeout(ret);
> > if (!ret)
> > break;
> > }
> > finish_wait(&wq, &__wait);
> > } while (0)
>
>

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

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