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++/105730] [12/13 Regression] Issue with commit - Allow std::condition_variable waits to be cancelled Date: Wed, 21 Dec 2022 13:22:24 +0000 [thread overview] Message-ID: <bug-105730-4-VxwdyuBGMY@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105730-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105730 --- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> --- I think this should solve the problem: --- a/libstdc++-v3/src/c++11/compatibility-condvar.cc +++ b/libstdc++-v3/src/c++11/compatibility-condvar.cc @@ -67,6 +67,22 @@ _GLIBCXX_END_NAMESPACE_VERSION && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { +namespace +{ + std::__condvar std::condition_variable::* __base_member; + + template<std::__condvar std::condition_variable::*X> + struct cracker + { + static std::__condvar std::condition_variable::* value; + }; + template<std::__condvar std::condition_variable::*X> + std::__condvar std::condition_variable::* + cracker<X>::value = __base_member = X; + + template class cracker<&std::condition_variable::_M_cond>; +} + struct __nothrow_wait_cv : std::condition_variable { void wait(std::unique_lock<std::mutex>&) noexcept; @@ -76,7 +92,7 @@ __attribute__((used)) void __nothrow_wait_cv::wait(std::unique_lock<std::mutex>& lock) noexcept { - this->condition_variable::wait(lock); + (this->*__base_member).wait(*lock.mutex()); } } // namespace __gnu_cxx
next prev parent reply other threads:[~2022-12-21 13:22 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-25 17:32 [Bug libstdc++/105730] New: " lancethepants at gmail dot com 2022-05-26 9:18 ` [Bug libstdc++/105730] " marxin at gcc dot gnu.org 2022-05-26 9:18 ` marxin at gcc dot gnu.org 2022-10-25 7:17 ` [Bug libstdc++/105730] [12/13 Regression] " pinskia at gcc dot gnu.org 2022-10-25 11:57 ` redi at gcc dot gnu.org 2022-10-25 12:01 ` redi at gcc dot gnu.org 2022-12-20 13:48 ` rguenth at gcc dot gnu.org 2022-12-20 15:50 ` pinskia at gcc dot gnu.org 2022-12-21 11:52 ` redi at gcc dot gnu.org 2022-12-21 12:10 ` redi at gcc dot gnu.org 2022-12-21 12:24 ` glex.spb at gmail dot com 2022-12-21 13:22 ` redi at gcc dot gnu.org [this message] 2022-12-21 13:22 ` redi at gcc dot gnu.org 2022-12-21 13:45 ` glex.spb at gmail dot com 2022-12-22 23:35 ` cvs-commit at gcc dot gnu.org 2023-01-17 18:25 ` [Bug libstdc++/105730] [12 " lancethepants at gmail dot com 2023-01-17 19:01 ` redi at gcc dot gnu.org 2023-01-17 19:23 ` glex.spb at gmail dot com 2023-01-18 15:14 ` cvs-commit at gcc dot gnu.org 2023-01-18 15:15 ` 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-105730-4-VxwdyuBGMY@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: linkBe 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).