public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: y00575850 <yangyanchao6@huawei.com>
Cc: libc-stable@sourceware.org, carlos@systemhalted.org, wuxu.wu@huawei.com
Subject: Re: sem_timedwait: The semaphore times out when the clock_REALTIME is used.
Date: Thu, 8 Apr 2021 15:10:51 +0100	[thread overview]
Message-ID: <20210408141049.GQ23289@arm.com> (raw)
In-Reply-To: <20210406130933.1915-1-yangyanchao6@huawei.com>

The 04/06/2021 21: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.

this is the wrong list.

you don't seem to understand the interface contract of sem_timedwait,
it cannot change the used clock.

glibc has non-standard apis to wait with different clock
https://www.gnu.org/software/libc/manual/html_node/Waiting-with-Explicit-Clocks.html

      reply	other threads:[~2021-04-08 14:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 13:09 y00575850
2021-04-08 14:10 ` Szabolcs Nagy [this message]

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=20210408141049.GQ23289@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=carlos@systemhalted.org \
    --cc=libc-stable@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).