Rev 534 | Rev 623 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 534 | Rev 557 | ||
|---|---|---|---|
| Line 36... | Line 36... | ||
| 36 | #include <list.h> |
36 | #include <list.h> |
| 37 | 37 | ||
| 38 | #define WAKEUP_FIRST 0 |
38 | #define WAKEUP_FIRST 0 |
| 39 | #define WAKEUP_ALL 1 |
39 | #define WAKEUP_ALL 1 |
| 40 | 40 | ||
| - | 41 | /** Wait queue structure. */ |
|
| 41 | struct waitq { |
42 | struct waitq { |
| - | 43 | ||
| - | 44 | /** Lock protecting wait queue structure. |
|
| - | 45 | * |
|
| - | 46 | * Must be acquired before T.lock for each T of type thread_t. |
|
| - | 47 | */ |
|
| 42 | spinlock_t lock; |
48 | spinlock_t lock; |
| - | 49 | ||
| 43 | int missed_wakeups; /**< Number of waitq_wakeup() calls that didn't find a thread to wake up. */ |
50 | int missed_wakeups; /**< Number of waitq_wakeup() calls that didn't find a thread to wake up. */ |
| 44 | link_t head; /**< List of sleeping threads for wich there was no missed_wakeup. */ |
51 | link_t head; /**< List of sleeping threads for wich there was no missed_wakeup. */ |
| 45 | }; |
52 | }; |
| 46 | 53 | ||
| 47 | #define waitq_sleep(wq) \ |
54 | #define waitq_sleep(wq) \ |
| Line 49... | Line 56... | ||
| 49 | 56 | ||
| 50 | extern void waitq_interrupted_sleep(void *data); |
57 | extern void waitq_interrupted_sleep(void *data); |
| 51 | 58 | ||
| 52 | extern void waitq_initialize(waitq_t *wq); |
59 | extern void waitq_initialize(waitq_t *wq); |
| 53 | extern int waitq_sleep_timeout(waitq_t *wq, __u32 usec, int nonblocking); |
60 | extern int waitq_sleep_timeout(waitq_t *wq, __u32 usec, int nonblocking); |
| 54 | extern void waitq_wakeup(waitq_t *wq, int all); |
61 | extern void waitq_wakeup(waitq_t *wq, bool all); |
| 55 | extern void _waitq_wakeup_unsafe(waitq_t *wq, int all); |
62 | extern void _waitq_wakeup_unsafe(waitq_t *wq, bool all); |
| 56 | 63 | ||
| 57 | #endif |
64 | #endif |