Rev 1757 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1757 | Rev 1780 | ||
|---|---|---|---|
| Line 212... | Line 212... | ||
| 212 | * asleep at all. |
212 | * asleep at all. |
| 213 | * |
213 | * |
| 214 | * @li ESYNCH_OK_BLOCKED means that the sleep succeeded; the full sleep was |
214 | * @li ESYNCH_OK_BLOCKED means that the sleep succeeded; the full sleep was |
| 215 | * attempted. |
215 | * attempted. |
| 216 | */ |
216 | */ |
| 217 | int waitq_sleep_timeout(waitq_t *wq, __u32 usec, int flags) |
217 | int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, int flags) |
| 218 | { |
218 | { |
| 219 | ipl_t ipl; |
219 | ipl_t ipl; |
| 220 | int rc; |
220 | int rc; |
| 221 | 221 | ||
| 222 | ipl = waitq_sleep_prepare(wq); |
222 | ipl = waitq_sleep_prepare(wq); |
| Line 295... | Line 295... | ||
| 295 | * @param usec See waitq_sleep_timeout(). |
295 | * @param usec See waitq_sleep_timeout(). |
| 296 | * @param flags See waitq_sleep_timeout(). |
296 | * @param flags See waitq_sleep_timeout(). |
| 297 | * |
297 | * |
| 298 | * @return See waitq_sleep_timeout(). |
298 | * @return See waitq_sleep_timeout(). |
| 299 | */ |
299 | */ |
| 300 | int waitq_sleep_timeout_unsafe(waitq_t *wq, __u32 usec, int flags) |
300 | int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, int flags) |
| 301 | { |
301 | { |
| 302 | /* checks whether to go to sleep at all */ |
302 | /* checks whether to go to sleep at all */ |
| 303 | if (wq->missed_wakeups) { |
303 | if (wq->missed_wakeups) { |
| 304 | wq->missed_wakeups--; |
304 | wq->missed_wakeups--; |
| 305 | return ESYNCH_OK_ATOMIC; |
305 | return ESYNCH_OK_ATOMIC; |
| Line 349... | Line 349... | ||
| 349 | /* Short emulation of scheduler() return code. */ |
349 | /* Short emulation of scheduler() return code. */ |
| 350 | spinlock_unlock(&THREAD->lock); |
350 | spinlock_unlock(&THREAD->lock); |
| 351 | return ESYNCH_TIMEOUT; |
351 | return ESYNCH_TIMEOUT; |
| 352 | } |
352 | } |
| 353 | THREAD->timeout_pending = true; |
353 | THREAD->timeout_pending = true; |
| 354 | timeout_register(&THREAD->sleep_timeout, (__u64) usec, waitq_timeouted_sleep, THREAD); |
354 | timeout_register(&THREAD->sleep_timeout, (uint64_t) usec, waitq_timeouted_sleep, THREAD); |
| 355 | } |
355 | } |
| 356 | 356 | ||
| 357 | list_append(&THREAD->wq_link, &wq->head); |
357 | list_append(&THREAD->wq_link, &wq->head); |
| 358 | 358 | ||
| 359 | /* |
359 | /* |