Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sched/semaphore/sem_tickwait.c: Fix nxsem_tickwait_uninterruptible en…
…d condition nxsem_tickwait correctly sleeps more than 1 tick. But nxsem_tickwait_uninterruptible may wake up to a signal (with -EINTR), in which case the tick + 1 must also be taken into account. Otherwise the nxsem_tickwait_uninterruptible may wake up 1 tick too early. This patch has the side effect that if such a wakeup by signal occurs at the last waiting tick, the nxsem_tickwait_uninterruptible may end up sleeping one tick too long due to nxsem_tickwait won't ever timeout at the next tick. This is however (more) correct behaviour than waking up too early. Also fix the nxsem_tickwait to return with -ETIMEDOUT if called with delay 0. This is similar to e.g. posix sem_timedwait. Signed-off-by: Jukka Laitinen <[email protected]>
- Loading branch information