gcc/libstdc++-v3
Thomas W Rodgers 7c21556daf 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.
2022-04-22 15:53:41 -07:00
..
config libstdc++: Fix symbol versioning for Solaris 11.3 [PR103407] 2022-03-16 21:16:53 +00:00
doc libstdc++: Use LTLIBICONV when linking libstdc++.so [PR93602] 2022-04-20 13:54:57 +01:00
include libstdc++: Make atomic notify_one and notify_all non-const 2022-04-22 15:53:41 -07:00
libsupc++ libstdc++: Add comment about memalign requirements 2022-03-31 16:18:00 +01:00
po libstdc++: Define <stacktrace> header for C++23 2022-01-17 12:13:02 +00:00
python libstdc++: Add pretty printer for std::span 2022-04-19 14:18:33 +01:00
scripts libstdc++: Only add valid -L paths to testsuite linker options 2022-01-20 12:29:29 +00:00
src libstdc++: Avoid ASCII assumptions in floating_from_chars.cc 2022-04-21 12:11:01 -04:00
testsuite libstdc++: Make atomic notify_one and notify_all non-const 2022-04-22 15:53:41 -07:00
acinclude.m4 libstdc++: Fix syntax error in libbacktrace configuration 2022-04-19 11:58:30 +01:00
aclocal.m4
ChangeLog Daily bump. 2022-04-22 00:16:43 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
ChangeLog-2021 Rotate ChangeLog files - part 1 - add ChangeLog-2021. 2022-01-03 10:18:16 +01:00
config.h.in libstdc++: Prefer to use mmap instead of malloc in libbacktrace 2022-04-12 22:38:31 +01:00
configure libstdc++: Fix syntax error in libbacktrace configuration 2022-04-19 11:58:30 +01:00
configure.ac libstdc++: Remove -gdwarf-4 from flags for debug library 2022-01-19 19:31:00 +00:00
configure.host
crossconfig.m4 libstdc++: Check for TLS support on mingw cross-compilers 2021-09-15 09:49:33 +01:00
fragment.am
linkage.m4
Makefile.am Update copyright years. 2022-01-03 10:42:10 +01:00
Makefile.in libstdc++: Define <stacktrace> header for C++23 2022-01-17 12:13:02 +00:00
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.