[lkml]   [2001]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: wait_event() :(
On Wed, 3 Oct 2001, Jan Hudec wrote:

> > I have a doubt regarding wait_event.
> > In the macro __wait_event, the calling process changes its state to
> > TASK_UNINTERRUPTIBLE and calls schedule.
> > And does this in infinite loop.
> > After the loop, it itself changes its state to TASK_RUNNING.
> >
> > Once it calls schedule(), the scheduler will remove it from task list as
> > it is in uninterruptible mode.
> > Then when does it come again into running state to check the condition.
> >
> > kindly cc the reply to me as i'm not subscribed to the list
> > thanks
> It inserts itself in a wait queue. The schedule returns when wakeup is called
> on the wait queue.
> --------------------------------------------------------------------------------
> - Jan Hudec `Bulb' <>

Then why does it have a for(;;) around it when anyway someone is going to
wake it up after the condition is true.
Or is that it may be woken up even when the condition is not true.

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 13:03    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean