sem_timedwait3(..., ..., clockid_t)

Eric van Gyzen vangyzen at FreeBSD.org
Wed Feb 15 21:38:55 UTC 2017


Would anyone else be interested in me adding a sem_timedwait3() function?

int sem_timedwait3(sem_t *sem, const struct timespec *abs_timeout,
     clockid_t clock_id);

The clock_id would specify the reference clock for the absolute timeout. 
  The standard sem_timedwait() API uses CLOCK_REALTIME, which does not 
play nicely with large clock adjustments.

I realize it would be non-standard.  I also realize that there are 
standard APIs that should probably be used instead, such as Pthread 
condition variables with pthread_condattr_setclock(3).  On the other 
hand, the diff is [currently] tiny, so I thought I would offer it.

Cheers,

Eric


More information about the freebsd-arch mailing list