posix: pthread: condition variables always wait on clock monotonic #88587
Labels
area: POSIX
POSIX API Library
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Describe the bug
Two issues in one:
The POSIX spec indicates that the default clock used for condition variables should be
CLOCK_REALTIME
. However, Zephyr effectively always usesCLOCK_MONOTONIC
.Additionally, when a
pthread_condattr_t
is initialized as using any clock id, the clock id in that attribute is ignored in subsequent calls topthread_cond_timedwait()
.Please also mention any information which could help others to understand
the problem you're facing:
To Reproduce
Steps to reproduce the behavior:
Can fill in later, if necessary. It's pretty evident from the source though.
Expected behavior
Should be able to specify which clock to use for
pthread_cond_timedwait()
, as long asPOSIX_CLOCK_SELECTION
is enabled.Impact
This will throw conformant applications a bit of a curveball in terms of timing expectations.
Logs and console output
Environment (please complete the following information):
Additional context
Discovered in the context of #88547
The text was updated successfully, but these errors were encountered: