Skip to content
Commit 1831431b authored by Christopher Friedt's avatar Christopher Friedt
Browse files

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: default avatarChristopher Friedt <chrisfriedt@gmail.com>
(cherry picked from commit 9d433c89)
parent 765f63c6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment