sched/semaphore: add the wdog judge before cancel

N/A

to avoid entering critical again in wd_cancel when wdog not actived. But when the wdog is actived, may add more judge
This commit is contained in:
luoyong1 2022-08-19 14:02:45 +08:00 committed by Petro Karashchenko
parent 1047b65ab5
commit 126ce6428e

View File

@ -151,7 +151,10 @@ int nxsem_post(FAR sem_t *sem)
/* Stop the watchdog timer */
wd_cancel(&stcb->waitdog);
if (WDOG_ISACTIVE(&stcb->waitdog))
{
wd_cancel(&stcb->waitdog);
}
/* Restart the waiting task. */