unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Mike Crowe <mac@mcrowe.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	libc-alpha@sourceware.org, Carlos O'Donell <carlos@redhat.com>
Subject: pthread_cond_clockwait glibc forwarder (was Re: [RFCv4] Add pthread_cond_timedwaitonclock_np)
Date: Tue, 16 Jul 2019 11:05:16 +0100	[thread overview]
Message-ID: <20190716100516.fvizo6mhm2hnztxz@mcrowe.com> (raw)
In-Reply-To: <77064c8d-2aa8-4345-0d6d-3a873a5e684f@linaro.org>

[pthread_cond_clockwait was previously known as
pthread_cond_timedwaitonclock_np.]

On Monday 02 October 2017 at 19:26:35 -0300, Adhemerval Zanella wrote:
> >>> diff --git a/nptl/Versions b/nptl/Versions
> >>> index 0ae5def464..1cf8c2fbad 100644
> >>> --- a/nptl/Versions
> >>> +++ b/nptl/Versions
> >>> @@ -28,6 +28,9 @@ libc {
> >>>      pthread_cond_wait; pthread_cond_signal;
> >>>      pthread_cond_broadcast; pthread_cond_timedwait;
> >>>    }
> >>> +  GLIBC_2.26 {
> >>> +    pthread_cond_timedwaitonclock_np;
> >>> +  }
> >>
> >> The libc addition seems wrong, whhy this is required?
> > 
> > pthread_cond_timedwait is in libc, so I followed suit and added
> > pthread_cond_timedwaitonclock_np too. I must admit that I can't quite see
> > how the dummy empty implementations of the pthread functions end up in
> > libc, but they apparently do according to:
> > 
> > https://stackoverflow.com/questions/11161462/why-glibc-and-pthread-library-both-defined-same-apis
> > 
> > Maybe this means that I've missed something.
> 
> This is an GLIB implementation detail, where some libraries which
> are expected to be usable without explicit linking to libpthread use
> some pthread functions (for instance aio from librt). 
> 
> In the single thread case libc.so uses wrappers that may or not call the
> libpthread.so implementation (nptl/forward.c) if libpthread.so.0 is
> loaded (by dlopen for instance).
> 
> So since there is no current use of pthread_cond_timedwaitonclock_np,
> there is no requirement to add it on libc.so.

I was digging through some old review comments, and came across this. It
looks like I didn't address it. :( afe4de7d283ebd88157126c5494ce1796194c16e
added forwarders for __pthread_cond_clockwait and pthread_clock_clockwait
to glibc:

$ nm /lib64/libc.so.6 |grep _clockwait
000000000007f410 t __pthread_cond_clockwait
000000000007f410 t pthread_cond_clockwait

Should we remove them now, before they are included in a release and it's
too late? (I tried removing them from forward.c, pthread-functions.h and
nptl-init.c and all tests passed on x86_64.)

Alternatively, if they should stay, do they need adding to the libc part of
nptl/Versions?

Thanks, and sorry for not discovering this earlier.

Mike.

  reply	other threads:[~2019-07-16 10:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22 17:05 [RFCv4] Add pthread_cond_timedwaitonclock_np Mike Crowe
2017-06-28 14:39 ` Adhemerval Zanella
2017-09-21 20:43   ` Mike Crowe
2017-09-30 16:01   ` Mike Crowe
2017-10-02 22:26     ` Adhemerval Zanella
2019-07-16 10:05       ` Mike Crowe [this message]
2019-07-16 11:00         ` pthread_cond_clockwait glibc forwarder (was Re: [RFCv4] Add pthread_cond_timedwaitonclock_np) Florian Weimer
2019-07-16 14:31           ` Mike Crowe
2019-07-16 16:11           ` Carlos O'Donell

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=20190716100516.fvizo6mhm2hnztxz@mcrowe.com \
    --to=mac@mcrowe.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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).