zephyr/lib/posix
Christopher Friedt 9d433c89a2 lib: posix: semaphore: use consistent timebase in sem_timedwait
In the Zephyr implementation, `sem_timedwait()` uses a
potentially wildly different timebase for comparison via
`k_uptime_get()` (uptime in ms).

The standard specifies `CLOCK_REALTIME`. However, the real-time
clock can be modified to an arbitrary value via clock_settime()
and there is no guarantee that it will always reflect uptime.

This change ensures that `sem_timedwait()` uses a more
consistent timebase for comparison.

Fixes #46807

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2022-06-24 20:12:05 +02:00
..
getopt lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
clock.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
CMakeLists.txt include: Prefix includes to use a scope 2022-04-08 19:03:32 +02:00
eventfd.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
fs.c lib/posix/fs: fix end-of-dir in readdir 2022-05-13 11:10:04 -07:00
Kconfig lib: posix: semaphore: use consistent timebase in sem_timedwait 2022-06-24 20:12:05 +02:00
mqueue.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
nanosleep.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
pthread_barrier.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
pthread_common.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
pthread_cond.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
pthread_key.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
pthread_mutex.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
pthread_rwlock.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
pthread_sched.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
pthread.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
semaphore.c lib: posix: semaphore: use consistent timebase in sem_timedwait 2022-06-24 20:12:05 +02:00
sleep.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00
timer.c lib: migrate includes to <zephyr/...> 2022-05-06 19:58:09 +02:00