[Bug libstdc++/97949] Recursive calls of std::call_once together with cout leads to deadlock under mingw64
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Nov 23 20:44:18 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97949
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This isn't specific to mingw, it's a bug in the std::call_once implementation
for non-TLS targets. t2 runs outerDoOnce() and tries to acquire a mutex lock
before running innerDoOnce(), but that mutex is held by t3 while it waits to
try to run outerDoOnce(). t3 won't proceed until t2 finishes, which is blocked
by t3.
More information about the Gcc-bugs
mailing list