[Bug libstdc++/77704] Data race on std::cype
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 23 09:35:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77704
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-09-23
Summary|Data race on std::regex |Data race on std::cype
Ever confirmed|0 |1
Severity|major |normal
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Ugh, we have mutable members in std::ctype<char>
#include <locale>
#include <thread>
int main()
{
auto& ctype = std::use_facet<std::ctype<char>>(std::locale::classic());
auto f = [&]{ for (int i = 0; i < 64; ++i) ctype.narrow(i, 'a'); };
std::thread t1{f};
std::thread t2{f};
t1.join();
t2.join();
}
More information about the Gcc-bugs
mailing list