VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/module/waitcompat.h@ 6051

Last change on this file since 6051 was 5753, checked in by vboxsync, 17 years ago

fixed header.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1/* copied from linux/wait.h */
2
3#ifndef wait_event_timeout
4#define wait_event_timeout(wq, condition, timeout) \
5({ \
6 long __ret = timeout; \
7 if (!(condition)) \
8 __wait_event_timeout(wq, condition, __ret); \
9 __ret; \
10 })
11
12#define __wait_event_timeout(wq, condition, ret) \
13do { \
14 wait_queue_t __wait; \
15 init_waitqueue_entry(&__wait, current); \
16 \
17 add_wait_queue(&wq, &__wait); \
18 for (;;) { \
19 set_current_state(TASK_UNINTERRUPTIBLE); \
20 if (condition) \
21 break; \
22 ret = schedule_timeout(ret); \
23 if (!ret) \
24 break; \
25 } \
26 current->state = TASK_RUNNING; \
27 remove_wait_queue(&wq, &__wait); \
28} while (0)
29#endif
30
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette