sched:add holder in sem_trywait

Avoid priority rollover

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao
2021-12-17 11:21:04 +08:00
committed by Xiang Xiao
parent b10dcf7c0d
commit 9a53601ba9
+1
View File
@@ -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;
} }