mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
sched:add holder in sem_trywait
Avoid priority rollover Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
@@ -90,6 +90,7 @@ int nxsem_trywait(FAR sem_t *sem)
|
|||||||
/* It is, let the task take the semaphore */
|
/* It is, let the task take the semaphore */
|
||||||
|
|
||||||
sem->semcount--;
|
sem->semcount--;
|
||||||
|
nxsem_add_holder(sem);
|
||||||
rtcb->waitsem = NULL;
|
rtcb->waitsem = NULL;
|
||||||
ret = OK;
|
ret = OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user