Rev 2909 | Rev 2916 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2909 | Rev 2914 | ||
---|---|---|---|
Line 69... | Line 69... | ||
69 | wq->missed_wakeups = 0; |
69 | wq->missed_wakeups = 0; |
70 | } |
70 | } |
71 | 71 | ||
72 | /** Handle timeout during waitq_sleep_timeout() call |
72 | /** Handle timeout during waitq_sleep_timeout() call |
73 | * |
73 | * |
74 | * This routine is called when waitq_sleep_timeout() timeouts. |
74 | * This routine is called when waitq_sleep_timeout() times out. |
75 | * Interrupts are disabled. |
75 | * Interrupts are disabled. |
76 | * |
76 | * |
77 | * It is supposed to try to remove 'its' thread from the wait queue; |
77 | * It is supposed to try to remove 'its' thread from the wait queue; |
78 | * it can eventually fail to achieve this goal when these two events |
78 | * it can eventually fail to achieve this goal when these two events |
79 | * overlap. In that case it behaves just as though there was no |
79 | * overlap. In that case it behaves just as though there was no |
Line 290... | Line 290... | ||
290 | } |
290 | } |
291 | 291 | ||
292 | /** Internal implementation of waitq_sleep_timeout(). |
292 | /** Internal implementation of waitq_sleep_timeout(). |
293 | * |
293 | * |
294 | * This function implements logic of sleeping in a wait queue. |
294 | * This function implements logic of sleeping in a wait queue. |
295 | * This call must be preceeded by a call to waitq_sleep_prepare() |
295 | * This call must be preceded by a call to waitq_sleep_prepare() |
296 | * and followed by a call to waitq_slee_finish(). |
296 | * and followed by a call to waitq_sleep_finish(). |
297 | * |
297 | * |
298 | * @param wq See waitq_sleep_timeout(). |
298 | * @param wq See waitq_sleep_timeout(). |
299 | * @param usec See waitq_sleep_timeout(). |
299 | * @param usec See waitq_sleep_timeout(). |
300 | * @param flags See waitq_sleep_timeout(). |
300 | * @param flags See waitq_sleep_timeout(). |
301 | * |
301 | * |
Line 404... | Line 404... | ||
404 | * |
404 | * |
405 | * This is the internal SMP- and IRQ-unsafe version of waitq_wakeup(). It |
405 | * This is the internal SMP- and IRQ-unsafe version of waitq_wakeup(). It |
406 | * assumes wq->lock is already locked and interrupts are already disabled. |
406 | * assumes wq->lock is already locked and interrupts are already disabled. |
407 | * |
407 | * |
408 | * @param wq Pointer to wait queue. |
408 | * @param wq Pointer to wait queue. |
409 | * @param mode If mode is WAKEUP_FIRST, then the longest waiting thread, |
409 | * @param mode If mode is WAKEUP_FIRST, then the longest waitingi |
410 | * if any, is woken up. If mode is WAKEUP_ALL, then all |
410 | * thread, if any, is woken up. If mode is WAKEUP_ALL, then |
411 | * waiting threads, if any, are woken up. If there are no |
411 | * all waiting threads, if any, are woken up. If there are |
412 | * waiting threads to be woken up, the missed wakeup is |
412 | * no waiting threads to be woken up, the missed wakeup is |
413 | * recorded in the wait queue. |
413 | * recorded in the wait queue. |
414 | */ |
414 | */ |
415 | void _waitq_wakeup_unsafe(waitq_t *wq, wakeup_mode_t mode) |
415 | void _waitq_wakeup_unsafe(waitq_t *wq, wakeup_mode_t mode) |
416 | { |
416 | { |
417 | thread_t *t; |
417 | thread_t *t; |