Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit aa406206 authored by Christopher Friedt's avatar Christopher Friedt Committed by github-actions[bot]
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 1efe6de3
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment