Changeset 1b20da0 in mainline for kernel/generic/src/synch/condvar.c
- Timestamp:
- 2018-02-28T17:52:03Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3061bc1
- Parents:
- df6ded8
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/condvar.c
rdf6ded8 r1b20da0 107 107 108 108 /** Wait for the condition to become true with a locked spinlock. 109 * 109 * 110 110 * The function is not aware of irq_spinlock. Therefore do not even 111 111 * try passing irq_spinlock_t to it. Use _condvar_wait_timeout_irq_spinlock() … … 124 124 * @return See comment for waitq_sleep_timeout(). 125 125 */ 126 errno_t _condvar_wait_timeout_spinlock_impl(condvar_t *cv, spinlock_t *lock, 126 errno_t _condvar_wait_timeout_spinlock_impl(condvar_t *cv, spinlock_t *lock, 127 127 uint32_t usec, int flags) 128 128 { … … 148 148 149 149 /** Wait for the condition to become true with a locked irq spinlock. 150 * 150 * 151 151 * @param cv Condition variable. 152 152 * @param lock Locked irq spinlock. … … 161 161 * @return See comment for waitq_sleep_timeout(). 162 162 */ 163 errno_t _condvar_wait_timeout_irq_spinlock(condvar_t *cv, irq_spinlock_t *irq_lock, 163 errno_t _condvar_wait_timeout_irq_spinlock(condvar_t *cv, irq_spinlock_t *irq_lock, 164 164 uint32_t usec, int flags) 165 165 { … … 171 171 irq_lock->guard = false; 172 172 173 /* 174 * waitq_prepare() restores interrupts to the current state, 175 * ie disabled. Therefore, interrupts will remain disabled while 176 * it spins waiting for a pending timeout handler to complete. 173 /* 174 * waitq_prepare() restores interrupts to the current state, 175 * ie disabled. Therefore, interrupts will remain disabled while 176 * it spins waiting for a pending timeout handler to complete. 177 177 * Although it spins with interrupts disabled there can only 178 178 * be a pending timeout if we failed to cancel an imminent 179 * timeout (on another cpu) during a wakeup. As a result the 180 * timeout handler is guaranteed to run (it is most likely already 179 * timeout (on another cpu) during a wakeup. As a result the 180 * timeout handler is guaranteed to run (it is most likely already 181 181 * running) and there is no danger of a deadlock. 182 182 */
Note:
See TracChangeset
for help on using the changeset viewer.