Rev 2071 | Rev 2089 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2071 | Rev 2085 | ||
---|---|---|---|
Line 43... | Line 43... | ||
43 | 43 | ||
44 | #define WAKEUP_FIRST 0 |
44 | #define WAKEUP_FIRST 0 |
45 | #define WAKEUP_ALL 1 |
45 | #define WAKEUP_ALL 1 |
46 | 46 | ||
47 | /** Wait queue structure. */ |
47 | /** Wait queue structure. */ |
48 | struct waitq { |
48 | typedef struct { |
49 | 49 | ||
50 | /** Lock protecting wait queue structure. |
50 | /** Lock protecting wait queue structure. |
51 | * |
51 | * |
52 | * Must be acquired before T.lock for each T of type thread_t. |
52 | * Must be acquired before T.lock for each T of type thread_t. |
53 | */ |
53 | */ |
54 | SPINLOCK_DECLARE(lock); |
54 | SPINLOCK_DECLARE(lock); |
55 | 55 | ||
56 | int missed_wakeups; /**< Number of waitq_wakeup() calls that didn't find a thread to wake up. */ |
56 | int missed_wakeups; /**< Number of waitq_wakeup() calls that didn't find a thread to wake up. */ |
57 | link_t head; /**< List of sleeping threads for wich there was no missed_wakeup. */ |
57 | link_t head; /**< List of sleeping threads for wich there was no missed_wakeup. */ |
58 | }; |
58 | } waitq_t; |
59 | 59 | ||
60 | #define waitq_sleep(wq) \ |
60 | #define waitq_sleep(wq) \ |
61 | waitq_sleep_timeout((wq),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NONE) |
61 | waitq_sleep_timeout((wq),SYNCH_NO_TIMEOUT,SYNCH_FLAGS_NONE) |
62 | 62 | ||
63 | extern void waitq_initialize(waitq_t *wq); |
63 | extern void waitq_initialize(waitq_t *wq); |