From 9a53601ba993d43684328dcae8750acb00a34cc7 Mon Sep 17 00:00:00 2001 From: anjiahao Date: Fri, 17 Dec 2021 11:21:04 +0800 Subject: [PATCH] sched:add holder in sem_trywait Avoid priority rollover Signed-off-by: anjiahao --- sched/semaphore/sem_trywait.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sched/semaphore/sem_trywait.c b/sched/semaphore/sem_trywait.c index 00f8b59079..506add37f0 100644 --- a/sched/semaphore/sem_trywait.c +++ b/sched/semaphore/sem_trywait.c @@ -90,6 +90,7 @@ int nxsem_trywait(FAR sem_t *sem) /* It is, let the task take the semaphore */ sem->semcount--; + nxsem_add_holder(sem); rtcb->waitsem = NULL; ret = OK; }