Rev 2308 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2308 | Rev 2315 | ||
|---|---|---|---|
| Line 38... | Line 38... | ||
| 38 | #include <arch/types.h> |
38 | #include <arch/types.h> |
| 39 | #include <synch/spinlock.h> |
39 | #include <synch/spinlock.h> |
| 40 | #include <synch/synch.h> |
40 | #include <synch/synch.h> |
| 41 | #include <adt/list.h> |
41 | #include <adt/list.h> |
| 42 | 42 | ||
| 43 | - | ||
| 44 | /** Specifies behavior of the waitq_wakeup */ |
- | |
| 45 | typedef enum { |
43 | typedef enum { |
| 46 | WAKEUP_FIRST = 0, /**< Wakes up only the first sleeping thread, if there |
44 | WAKEUP_FIRST = 0, |
| 47 | aren't any sleeping threads increments missed wakeups */ |
- | |
| 48 | WAKEUP_ALL = 1, /**< Wakes up all sleeping threads AND zeroes out |
- | |
| 49 | missed_wakeups */ |
45 | WAKEUP_ALL |
| 50 | WAKEUP_ALL_INC_MISSED, /**< Wakes up all sleeping threads OR increments |
- | |
| 51 | missed_wakeups if there aren't any */ |
- | |
| 52 | } wakeup_all_flag_t; |
46 | } wakeup_mode_t; |
| 53 | - | ||
| 54 | 47 | ||
| 55 | /** Wait queue structure. */ |
48 | /** Wait queue structure. */ |
| 56 | typedef struct { |
49 | typedef struct { |
| 57 | 50 | ||
| 58 | /** Lock protecting wait queue structure. |
51 | /** Lock protecting wait queue structure. |
| Line 77... | Line 70... | ||
| 77 | extern void waitq_initialize(waitq_t *wq); |
70 | extern void waitq_initialize(waitq_t *wq); |
| 78 | extern int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, int flags); |
71 | extern int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, int flags); |
| 79 | extern ipl_t waitq_sleep_prepare(waitq_t *wq); |
72 | extern ipl_t waitq_sleep_prepare(waitq_t *wq); |
| 80 | extern int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, int flags); |
73 | extern int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, int flags); |
| 81 | extern void waitq_sleep_finish(waitq_t *wq, int rc, ipl_t ipl); |
74 | extern void waitq_sleep_finish(waitq_t *wq, int rc, ipl_t ipl); |
| 82 | extern void waitq_wakeup(waitq_t *wq, int all); |
75 | extern void waitq_wakeup(waitq_t *wq, wakeup_mode_t mode); |
| 83 | extern void _waitq_wakeup_unsafe(waitq_t *wq, int all); |
76 | extern void _waitq_wakeup_unsafe(waitq_t *wq, wakeup_mode_t mode); |
| 84 | extern void waitq_interrupt_sleep(struct thread *t); |
77 | extern void waitq_interrupt_sleep(struct thread *t); |
| 85 | 78 | ||
| 86 | #endif |
79 | #endif |
| 87 | 80 | ||
| 88 | /** @} |
81 | /** @} |