public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Re: sem_timedwait: The semaphore times out when the clock_REALTIME is used.
       [not found] <20210406130933.1915-1-yangyanchao6@huawei.com>
@ 2021-04-06 13:30 ` Adhemerval Zanella
  0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2021-04-06 13:30 UTC (permalink / raw)
  To: y00575850, Libc-help; +Cc: carlos, wuxu.wu



On 06/04/2021 10:09, y00575850 via Libc-stable wrote:
> 	Dear Carlos,
> When I use sem_timedwait, a time jump will cause the semaphore to time out. 
> While I know that using CLOCK_REALTIME is POSIX-defined behavior, it doesn't 
> fit the actual meaning of this function.To solve this problem, modify the 
> sem_timedwait process, for example: add a switch control. 
> Or add an interface that uses the Clock_MONOTONIC interface.
>

On glibc 2.30 we added the GNU extension sem_clockwait where you can 
specify the clock against which the timeout will be measured.

(I moved this conversation it to libc-help, libc-stable is usually for
discussion regarding backporting and issue against older releases).

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-06 13:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210406130933.1915-1-yangyanchao6@huawei.com>
2021-04-06 13:30 ` sem_timedwait: The semaphore times out when the clock_REALTIME is used Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).