Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2017 15:38:52 -0600
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
To:        "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   sem_timedwait3(..., ..., clockid_t)
Message-ID:  <1d1cb3d6-a2d2-1a3e-5d20-51206524ffbe@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1d1cb3d6-a2d2-1a3e-5d20-51206524ffbe>