public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* questions on wait_event ...
@ 2005-12-23  0:04 Alexey Shinkin
  0 siblings, 0 replies; 6+ messages in thread
From: Alexey Shinkin @ 2005-12-23  0:04 UTC (permalink / raw)
  To: linux-kernel

Hi , all !
Could anyone please clarify one thing in that old well known
wait_event_... code (taken from 2.6.5 wait.h ):

#define __wait_event_interruptible(wq, condition, ret)          \
do {                                                                    \
        wait_queue_t __wait;                                     \
        init_waitqueue_entry(&__wait, current);           \
                                                                        \
        add_wait_queue(&wq, &__wait);                   \
        for (;;) {                                                      \
                set_current_state(TASK_INTERRUPTIBLE);    \
                if (condition)                                          \
                        break;
........................................

Is it possible that scheduling happen after set_current_state() but before
checking the condition ?
If yes - even if we will have condition==TRUE by this moment - the scheduler
will make the process to sleep anyway , right ?

Regards
Alex Shinkin

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-12-23 20:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <5mIFB-6PS-33@gated-at.bofh.it>
2005-12-23  0:16 ` questions on wait_event Robert Hancock
2005-12-23  0:51   ` Alexey Shinkin
2005-12-23  1:10     ` Steven Rostedt
2005-12-23  1:46       ` Alexey Shinkin
2005-12-23 20:48         ` Steven Rostedt
2005-12-23  0:04 Alexey Shinkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox