Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2017 15:57:37 -0600
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
To:        freebsd-arch@freebsd.org
Subject:   Re: sem_timedwait3(..., ..., clockid_t)
Message-ID:  <e0bc00fc-36f4-a81b-62fc-367931b3929c@FreeBSD.org>
In-Reply-To: <1d1cb3d6-a2d2-1a3e-5d20-51206524ffbe@FreeBSD.org>
References:  <1d1cb3d6-a2d2-1a3e-5d20-51206524ffbe@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 02/15/2017 15:38, Eric van Gyzen wrote:
> 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.

kib@ suggested that I use the _np suffix, which is an obviously good 
idea, so the proposal is now:

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

Eric



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e0bc00fc-36f4-a81b-62fc-367931b3929c>