Changeset 4c78104 in mainline for kernel/generic/src/synch/semaphore.c
- Timestamp:
- 2023-02-09T16:55:34Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e994898
- Parents:
- c0b54c9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/semaphore.c
rc0b54c9 r4c78104 52 52 void semaphore_initialize(semaphore_t *sem, int val) 53 53 { 54 waitq_initialize(&sem->wq); 55 if (val != 0) 56 waitq_count_set(&sem->wq, val); 54 waitq_initialize_with_count(&sem->wq, val); 57 55 } 58 56 … … 100 98 } 101 99 102 /** Get the semaphore counter value.103 *104 * @param sem Semaphore.105 * @return The number of threads that can down the semaphore106 * without blocking.107 */108 int semaphore_count_get(semaphore_t *sem)109 {110 return waitq_count_get(&sem->wq);111 }112 113 100 /** @} 114 101 */
Note:
See TracChangeset
for help on using the changeset viewer.