linux - code for wait_event_interruptible -


where can find code wait_event_interruptible in kernel tree. can find wait_event_interruptible defined __wait_event_interruptible in . unable find code . please me out.

consider process has gone sleep wait_event_interruptible. suppose if there interrupt , interrupt handler wakes(wake_up_event_interruptible) sleeping process. process wake should condition given in wait_event_interruptible true ?

thanks

it's in include/linux/wait.h:

#define wait_event_interruptible(wq, condition)               \ ({                                                            \     int __ret = 0;                                            \     if (!(condition))                                         \         __wait_event_interruptible(wq, condition, __ret);     \     __ret;                                                    \ }) 

...

#define __wait_event_interruptible(wq, condition, ret)        \ {                                                          \     define_wait(__wait);                                      \                                                               \     (;;) {                                                \         prepare_to_wait(&wq, &__wait, task_interruptible);    \         if (condition)                                        \             break;                                            \         if (!signal_pending(current)) {                       \             schedule();                                       \             continue;                                         \         }                                                     \         ret = -erestartsys;                                   \         break;                                                \     }                                                         \     finish_wait(&wq, &__wait);                                \ } while (0) 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -