]> git.corax.cc Git - toolbox/commit
include/{mutex,wmutex,queue,sem}: Fix timeout behavior of blocking calls
authorMatthias Kruk <matthias.kruk@miraclelinux.com>
Fri, 18 Jun 2021 07:15:24 +0000 (16:15 +0900)
committerMatthias Kruk <matthias.kruk@miraclelinux.com>
Fri, 18 Jun 2021 07:15:24 +0000 (16:15 +0900)
commitb94ce8914852facec4ce7df177b9eadf8aea8ec5
treef1a2e9e05f836188625d5a4e6dc6919fb5e25942
parent0d2039a0f5ca8af1486410f3d78f84c4a4c7fc15
include/{mutex,wmutex,queue,sem}: Fix timeout behavior of blocking calls

Because of a bug in the timeout handling, the mutex_lock(),
wmutex_lock(), queue_get(), and sem_wait() functions wait forever if a
positive timeout is specified.
This commit changes the behavior so that the functions will wait
forever if the timeout is -1 or omitted, return immediately if the
timeout is zero, or otherwise wait for the specified number of seconds.
include/mutex.sh
include/queue.sh
include/sem.sh
include/wmutex.sh