diff options
Diffstat (limited to 'os/kernel')
-rw-r--r-- | os/kernel/src/chsem.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/os/kernel/src/chsem.c b/os/kernel/src/chsem.c index 6327be451..b3f9936b2 100644 --- a/os/kernel/src/chsem.c +++ b/os/kernel/src/chsem.c @@ -233,10 +233,11 @@ msg_t chSemSignalWait(Semaphore *sps, Semaphore *spw) { if (sps->s_cnt++ < 0)
chSchReadyI(fifo_remove(&sps->s_queue))->p_u.rdymsg = RDY_OK;
if (--spw->s_cnt < 0) {
- sem_insert(currp, &spw->s_queue);
- currp->p_u.wtobjp = spw;
+ Thread *ctp = currp;
+ sem_insert(ctp, &spw->s_queue);
+ ctp->p_u.wtobjp = spw;
chSchGoSleepS(THD_STATE_WTSEM);
- msg = currp->p_u.rdymsg;
+ msg = ctp->p_u.rdymsg;
}
else {
chSchRescheduleS();
|