public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/67408] <mutex> assumes that __gthread_mutex_t and__gthread_recursive_mutex_t are the same types
Date: Tue, 01 Sep 2015 15:39:00 -0000	[thread overview]
Message-ID: <bug-67408-4-AQ2XzZ709Q@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-67408-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67408

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Sebastian Huber from comment #4)
> Sorry, I should have linked my patch:
> 
> https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00028.html

AH yes, that would work too, and doesn't require the compiler to do any
overload resolution.

N.B. all libstdc++ patches need to be CC'd to the libstdc++ list, I don't read
gcc-patches.

> I think the your second version doesn't work in case the types are equal, it
> looks similar to my first attempt to fix this which didn't work on Linux.

It works fine, because the second overload is a worse overload because it
requires a conversion to void, so when the types are equal the first overload
is lways used.

When the types are not equal the first overload is not viable at all for
recursive mutexes, so the second is used, and the second argument is cast back
to the __gthread_time_t type.


  parent reply	other threads:[~2015-09-01 15:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31 11:29 [Bug libstdc++/67408] New: " sebastian.huber@embedded-brains.de
2015-09-01 14:49 ` [Bug libstdc++/67408] " redi at gcc dot gnu.org
2015-09-01 14:50 ` redi at gcc dot gnu.org
2015-09-01 15:18 ` redi at gcc dot gnu.org
2015-09-01 15:22 ` redi at gcc dot gnu.org
2015-09-01 15:37 ` sebastian.huber@embedded-brains.de
2015-09-01 15:39 ` redi at gcc dot gnu.org [this message]
2015-09-02  8:43 ` sebastian.huber@embedded-brains.de
2015-09-02 10:16 ` redi at gcc dot gnu.org
2015-09-02 10:45 ` sebastian.huber@embedded-brains.de
2015-09-02 10:51 ` redi at gcc dot gnu.org
2015-09-02 10:54 ` redi at gcc dot gnu.org

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=bug-67408-4-AQ2XzZ709Q@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).