RTEMS | cpukit/posix Added pthread clock functions (!547)

Sebastian Huber (@sebhub) gitlab at rtems.org
Thu Jul 10 01:59:51 UTC 2025




Sebastian Huber started a new discussion on cpukit/posix/src/condclockwait.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/547#note_126275

 > +#endif
 > +
 > +#include <rtems/posix/condimpl.h>
 > +
 > +int pthread_cond_clockwait(
 > +  pthread_cond_t        *cond,
 > +  pthread_mutex_t       *mutex,
 > +  clockid_t              clock_id,
 > +  const struct timespec *abstime
 > +)
 > +{
 > +  if ( abstime == NULL ) {
 > +    return EINVAL;
 > +  }
 > +  if ( clock_id != CLOCK_MONOTONIC && clock_id != CLOCK_REALTIME ) {
 > +    return EINVAL;

Checks for `clock_id` being `CLOCK_MONOTONIC` or `CLOCK_REALTIME` are used elsewhere. In a separate patch, I would add a `_Thread_queue_Context_set_enqueue_timeout_by_clock_id()` and a `_Thread_queue_Context_is_clock_id_valid()`. The timeout can then be set when needed by a new enqueue callout: `_Thread_queue_Add_timeout_by_clock_id()`. You may have to extend the `Thread_queue_Context` with a `clock_id` member.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/547#note_126275
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250710/3e76f227/attachment-0001.htm>


More information about the bugs mailing list