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 2087 | ||
---|---|---|---|
Line 184... | Line 184... | ||
184 | * @param usec Timeout in microseconds. |
184 | * @param usec Timeout in microseconds. |
185 | * @param flags Specify mode of the sleep. |
185 | * @param flags Specify mode of the sleep. |
186 | * |
186 | * |
187 | * The sleep can be interrupted only if the |
187 | * The sleep can be interrupted only if the |
188 | * SYNCH_FLAGS_INTERRUPTIBLE bit is specified in flags. |
188 | * SYNCH_FLAGS_INTERRUPTIBLE bit is specified in flags. |
189 | |
189 | * |
190 | * If usec is greater than zero, regardless of the value of the |
190 | * If usec is greater than zero, regardless of the value of the |
191 | * SYNCH_FLAGS_NON_BLOCKING bit in flags, the call will not return until either |
191 | * SYNCH_FLAGS_NON_BLOCKING bit in flags, the call will not return until either |
192 | * timeout, interruption or wakeup comes. |
192 | * timeout, interruption or wakeup comes. |
193 | * |
193 | * |
194 | * If usec is zero and the SYNCH_FLAGS_NON_BLOCKING bit is not set in flags, |
194 | * If usec is zero and the SYNCH_FLAGS_NON_BLOCKING bit is not set in flags, |
Line 350... | Line 350... | ||
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, (uint64_t) usec, |
354 | timeout_register(&THREAD->sleep_timeout, (uint64_t) usec, |
355 | waitq_timeouted_sleep, THREAD); |
355 | waitq_timeouted_sleep, THREAD); |
356 | } |
356 | } |
357 | 357 | ||
358 | list_append(&THREAD->wq_link, &wq->head); |
358 | list_append(&THREAD->wq_link, &wq->head); |
359 | 359 | ||
360 | /* |
360 | /* |