Changeset 4e33b6b in mainline for kernel/generic/src/synch/waitq.c
- Timestamp:
- 2007-01-07T14:44:33Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d78d603
- Parents:
- c109dd0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/waitq.c
rc109dd0 r4e33b6b 189 189 190 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 timeout,192 * interruption or wakeup comes.193 * 194 * If usec is zero and the SYNCH_FLAGS_NON_BLOCKING bit is not set in flags, the call195 * will not return until wakeup or interruption comes.196 * 197 * If usec is zero and the SYNCH_FLAGS_NON_BLOCKING bit is set in flags, the call will198 * immediately return, reporting either success or failure.199 * 200 * @return Returns one of: ESYNCH_WOULD_BLOCK, ESYNCH_TIMEOUT, ESYNCH_INTERRUPTED,201 * 202 * 203 * @li ESYNCH_WOULD_BLOCK means that the sleep failed because at the time 204 * of thecall there was no pending wakeup.191 * SYNCH_FLAGS_NON_BLOCKING bit in flags, the call will not return until either 192 * timeout, interruption or wakeup comes. 193 * 194 * If usec is zero and the SYNCH_FLAGS_NON_BLOCKING bit is not set in flags, 195 * the call will not return until wakeup or interruption comes. 196 * 197 * If usec is zero and the SYNCH_FLAGS_NON_BLOCKING bit is set in flags, the 198 * call will immediately return, reporting either success or failure. 199 * 200 * @return One of: ESYNCH_WOULD_BLOCK, ESYNCH_TIMEOUT, ESYNCH_INTERRUPTED, 201 * ESYNCH_OK_ATOMIC, ESYNCH_OK_BLOCKED. 202 * 203 * @li ESYNCH_WOULD_BLOCK means that the sleep failed because at the time of the 204 * call there was no pending wakeup. 205 205 * 206 206 * @li ESYNCH_TIMEOUT means that the sleep timed out. … … 352 352 } 353 353 THREAD->timeout_pending = true; 354 timeout_register(&THREAD->sleep_timeout, (uint64_t) usec, waitq_timeouted_sleep, THREAD); 354 timeout_register(&THREAD->sleep_timeout, (uint64_t) usec, 355 waitq_timeouted_sleep, THREAD); 355 356 } 356 357 … … 365 366 spinlock_unlock(&THREAD->lock); 366 367 367 scheduler(); /* wq->lock is released in scheduler_separated_stack() */ 368 /* wq->lock is released in scheduler_separated_stack() */ 369 scheduler(); 368 370 369 371 return ESYNCH_OK_BLOCKED; … … 373 375 /** Wake up first thread sleeping in a wait queue 374 376 * 375 * Wake up first thread sleeping in a wait queue. 376 * This is the SMP- and IRQ-safe wrapper meant for 377 * general use. 378 * 379 * Besides its 'normal' wakeup operation, it attempts 380 * to unregister possible timeout. 377 * Wake up first thread sleeping in a wait queue. This is the SMP- and IRQ-safe 378 * wrapper meant for general use. 379 * 380 * Besides its 'normal' wakeup operation, it attempts to unregister possible 381 * timeout. 381 382 * 382 383 * @param wq Pointer to wait queue. 383 * @param all If this is non-zero, all sleeping threads 384 * will be woken up andmissed count will be zeroed.384 * @param all If this is non-zero, all sleeping threads will be woken up and 385 * missed count will be zeroed. 385 386 */ 386 387 void waitq_wakeup(waitq_t *wq, bool all) … … 399 400 /** Internal SMP- and IRQ-unsafe version of waitq_wakeup() 400 401 * 401 * This is the internal SMP- and IRQ-unsafe version 402 * of waitq_wakeup(). It assumes wq->lock is already 403 * locked and interrupts are already disabled. 402 * This is the internal SMP- and IRQ-unsafe version of waitq_wakeup(). It 403 * assumes wq->lock is already locked and interrupts are already disabled. 404 404 * 405 405 * @param wq Pointer to wait queue. 406 * @param all If this is non-zero, all sleeping threads 407 * will be woken up andmissed count will be zeroed.406 * @param all If this is non-zero, all sleeping threads will be woken up and 407 * missed count will be zeroed. 408 408 */ 409 409 void _waitq_wakeup_unsafe(waitq_t *wq, bool all)
Note:
See TracChangeset
for help on using the changeset viewer.