aboutsummaryrefslogtreecommitdiffstats
path: root/src/chsem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/chsem.c')
-rw-r--r--src/chsem.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/chsem.c b/src/chsem.c
index ceaa64399..edec3b5db 100644
--- a/src/chsem.c
+++ b/src/chsem.c
@@ -47,18 +47,11 @@ void chSemInit(Semaphore *sp, t_cnt n) {
* \p RDY_RESET.
*/
void chSemReset(Semaphore *sp, t_cnt n) {
- t_cnt cnt;
- chDbgAssert(n >= 0, "chsem.c, chSemReset()");
chSysLock();
- cnt = sp->s_cnt;
- sp->s_cnt = n;
- if (cnt < 0) {
- while (cnt++)
- chSchReadyI(fifo_remove(&sp->s_queue), RDY_RESET);
- chSchRescheduleS();
- }
+ chSemResetI(sp, n);
+ chSchRescheduleS();
chSysUnlock();
}