]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Document thread-safety for COW std::string [PR21334]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 11 Apr 2025 10:08:34 +0000 (11:08 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 15 Apr 2025 08:33:55 +0000 (09:33 +0100)
commit31d7e0751e58ce006038fa5100a79da6ec6ddb7e
tree37f9ca93950e875a1d128ee5a7848622c364b39e
parentd48c5ec8f19b71c4591ea0bb4b05a960e13fc685
libstdc++: Document thread-safety for COW std::string [PR21334]

The gcc4-compatible copy-on-write std::string does not conform to the
C++11 requirements on data race avoidance in standard containers.
Specifically, calling non-const member functions such as begin() and
data() needs to do the "copy on write" operation and so is most
definitely a modification of the object. As such, those non-const
members must not be called concurrently with any other uses of the
string object.

libstdc++-v3/ChangeLog:

PR libstdc++/21334
* doc/xml/manual/using.xml: Document that container data race
avoidance rules do not apply to COW std::string.
* doc/html/*: Regenerate.

(cherry picked from commit dd35f66287b7cca196a720c9641e463255dceb1c)
libstdc++-v3/doc/html/manual/using_concurrency.html
libstdc++-v3/doc/xml/manual/using.xml