lkml.org 
[lkml]   [2005]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: questions on wait_event ...
Date

Look:

We call wait_event() , condition is FALSE at the moment :

do {
if (condition)
break;
/* and here we have condition changed to TRUE */
/* process is NOT in any wait queue yet */
/* then unroll __wait_event(wq, condition); */

do { DEFINE_WAIT(__wait); for (;;) {
prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE);

/* at this point condition is TRUE , process is in a wait queue
and its state is
TASK_UNINTERRUPTIBLE. If rescheduling happens now the
process will asleep,
despite of condition is TRUE . And will not be woken up until
next wake_up happens
Is that correct ? */

if (condition) break;
schedule();
}
finish_wait(&wq, &__wait);
} while (0)
/* end of unroll __wait_event*/

} while (0)

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

-
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-12-23 02:48    [W:0.043 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site