public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: y00575850 <yangyanchao6@huawei.com>,
	Libc-help <libc-help@sourceware.org>
Cc: carlos@systemhalted.org, wuxu.wu@huawei.com
Subject: Re: sem_timedwait: The semaphore times out when the clock_REALTIME is used.
Date: Tue, 6 Apr 2021 10:30:44 -0300	[thread overview]
Message-ID: <b7912f6e-4b09-9303-d4b7-9ee75a79efdb@linaro.org> (raw)
In-Reply-To: <20210406130933.1915-1-yangyanchao6@huawei.com>



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).

           reply	other threads:[~2021-04-06 13:30 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20210406130933.1915-1-yangyanchao6@huawei.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7912f6e-4b09-9303-d4b7-9ee75a79efdb@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=carlos@systemhalted.org \
    --cc=libc-help@sourceware.org \
    --cc=wuxu.wu@huawei.com \
    --cc=yangyanchao6@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).