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.