public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/102994] std::atomic<ptr>::wait is not marked const Date: Fri, 22 Apr 2022 22:54:46 +0000 [thread overview] Message-ID: <bug-102994-4-ar3hSXK57r@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-102994-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102994 --- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Thomas Rodgers <rodgertq@gcc.gnu.org>: https://gcc.gnu.org/g:977cbabeb1c1a9a28cc45655bdc693e1594642f0 commit r11-9931-g977cbabeb1c1a9a28cc45655bdc693e1594642f0 Author: Thomas W Rodgers <trodgers@redhat.com> Date: Fri Apr 22 15:46:19 2022 -0700 libstdc++: Make atomic notify_one and notify_all non-const <recording this here for future reference> PR102994 "atomics: std::atomic<ptr>::wait is not marked const" raises the issue that the current libstdc++ implementation marks the notify members const, the implementation strategy used by libstdc++, as well as libc++ and the Microsoft STL, do not require the atomic to be mutable (it is hard to conceive of a desirable implementation approach that would require it). The original paper proposing the wait/notify functionality for atomics (p1185) also had these members marked const for the first three revisions, but that was changed without explanation in r3 and subsequent revisions of the paper. After raising the issue to the authors of p1185 and the author of the libc++ implementation, the consensus seems to be "meh, it's harmless" so there seems little appetite for an LWG issue to revisit the subject. This patch changes the libstdc++ implementation to be in agreement with the standard by removing const from those notify_one/notify_all members. libstdc++-v3/ChangeLog: PR libstdc++/102994 * include/bits/atomic_base.h (atomic_flag::notify_one, notify_all): Remove const qualification. (__atomic_base::notify_one, notify_all): Likewise. * include/std/atomic (atomic<bool>::notify_one, notify_all): Likewise. (atomic::notify_one, notify_all): Likewise. (atomic<T*>::notify_one, notify_all): Likewise. (atomic_notify_one, atomic_notify_all): Likewise. * testsuite/29_atomics/atomic/wait_notify/102994.cc: Adjust test to account for change in notify_one/notify_all signature. (cherry picked from commit 7c21556daf385fe9ece37319f574776dd7d8ab1c)
next prev parent reply other threads:[~2022-04-22 22:54 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-10-29 2:37 [Bug libstdc++/102994] New: " gcc_bugzilla at axeitado dot com 2021-10-30 10:42 ` [Bug libstdc++/102994] " redi at gcc dot gnu.org 2021-12-10 1:57 ` cvs-commit at gcc dot gnu.org 2021-12-10 2:14 ` cvs-commit at gcc dot gnu.org 2021-12-10 10:52 ` redi at gcc dot gnu.org 2022-02-03 20:31 ` gcc_bugzilla at axeitado dot com 2022-02-03 21:01 ` redi at gcc dot gnu.org 2022-02-03 21:34 ` gcc_bugzilla at axeitado dot com 2022-02-04 0:03 ` rodgertq at gcc dot gnu.org 2022-02-04 0:33 ` redi at gcc dot gnu.org 2022-02-04 0:39 ` redi at gcc dot gnu.org 2022-02-04 0:44 ` redi at gcc dot gnu.org 2022-02-04 0:55 ` rodgertq at gcc dot gnu.org 2022-02-04 1:37 ` gcc_bugzilla at axeitado dot com 2022-02-04 10:55 ` redi at gcc dot gnu.org 2022-02-11 17:41 ` rodgertq at gcc dot gnu.org 2022-04-07 15:42 ` redi at gcc dot gnu.org 2022-04-21 7:50 ` rguenth at gcc dot gnu.org 2022-04-22 22:53 ` cvs-commit at gcc dot gnu.org 2022-04-22 22:54 ` cvs-commit at gcc dot gnu.org [this message] 2022-05-10 14:57 ` rodgertq 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-102994-4-ar3hSXK57r@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).