From owner-freebsd-arch@freebsd.org Wed Feb 15 21:57:38 2017 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5E1FCDF811 for ; Wed, 15 Feb 2017 21:57:38 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 96DD510F1 for ; Wed, 15 Feb 2017 21:57:38 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id B5EC0564C4 for ; Wed, 15 Feb 2017 15:57:37 -0600 (CST) Subject: Re: sem_timedwait3(..., ..., clockid_t) To: freebsd-arch@freebsd.org References: <1d1cb3d6-a2d2-1a3e-5d20-51206524ffbe@FreeBSD.org> From: Eric van Gyzen Message-ID: Date: Wed, 15 Feb 2017 15:57:37 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1d1cb3d6-a2d2-1a3e-5d20-51206524ffbe@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 21:57:38 -0000 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