public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r11-7293] libstdc++: Fix __thread_relax for non-gthreads non-x86 targets
Date: Fri, 19 Feb 2021 11:12:14 +0000 (GMT)	[thread overview]
Message-ID: <20210219111214.B7386389367C@sourceware.org> (raw)

https://gcc.gnu.org/g:9d449189ee4304ce4f250351c8aa393324421eef

commit r11-7293-g9d449189ee4304ce4f250351c8aa393324421eef
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Feb 19 09:54:04 2021 +0000

    libstdc++: Fix __thread_relax for non-gthreads non-x86 targets
    
    My recent change to the preprocessor conditions in __thread_relax() was
    supposed to also change the __gthread_yield() call to __thread_yield(),
    which has the right preprocessor checks. Instead I just removed the
    check for _GLIBCXX_USE_SCHED_YIELD which means the __gthread_yield()
    call will be ill-formed for non-gthreads targets, and targets without
    sched_yield(). This fixes it properly.
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/atomic_wait.h (__thread_relax()): Call
            __thread_yield() not __gthread_yield().

Diff:
---
 libstdc++-v3/include/bits/atomic_wait.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/bits/atomic_wait.h b/libstdc++-v3/include/bits/atomic_wait.h
index 37085ae8e50..424fccbe4c5 100644
--- a/libstdc++-v3/include/bits/atomic_wait.h
+++ b/libstdc++-v3/include/bits/atomic_wait.h
@@ -217,7 +217,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     __thread_yield() noexcept
     {
 #if defined _GLIBCXX_HAS_GTHREADS && defined _GLIBCXX_USE_SCHED_YIELD
-     __gthread_yield();
+      __gthread_yield();
 #endif
     }
 
@@ -227,7 +227,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #if defined __i386__ || defined __x86_64__
       __builtin_ia32_pause();
 #else
-      __gthread_yield();
+      __thread_yield();
 #endif
     }
   } // namespace __detail


                 reply	other threads:[~2021-02-19 11:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210219111214.B7386389367C@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@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).