Changeset 5df7928 in mainline
- Timestamp:
- 2010-05-25T21:33:52Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d7da4284
- Parents:
- b7398c0
- Location:
- kernel/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/synch/semaphore.h
rb7398c0 r5df7928 56 56 extern int _semaphore_down_timeout(semaphore_t *, uint32_t, unsigned int); 57 57 extern void semaphore_up(semaphore_t *); 58 extern int semaphore_count_get(semaphore_t *); 58 59 59 60 #endif -
kernel/generic/src/synch/semaphore.c
rb7398c0 r5df7928 54 54 { 55 55 waitq_initialize(&sem->wq); 56 57 irq_spinlock_lock(&sem->wq.lock, true); 58 sem->wq.missed_wakeups = val; 59 irq_spinlock_unlock(&sem->wq.lock, true); 56 waitq_count_set(&sem->wq, val); 60 57 } 61 58 … … 92 89 } 93 90 91 /** Get the semaphore counter value. 92 * 93 * @param sem Semaphore. 94 * @return The number of threads that can down the semaphore 95 * without blocking. 96 */ 97 int semaphore_count_get(semaphore_t *sem) 98 { 99 return waitq_count_get(&sem->wq); 100 } 101 94 102 /** @} 95 103 */
Note:
See TracChangeset
for help on using the changeset viewer.