[Bug libstdc++/12855] Thread safety problems in ios_base::Init

bkoz at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Dec 13 06:42:00 GMT 2003


------- Additional Comments From bkoz at gcc dot gnu dot org  2003-12-13 06:42 -------

Ouch. Of course, I only tested this with <iostream> and a modified version of
the kung-Foo class as it appeared in this bugzilla log.

With just <ios> I'm sure I'll see this. 

So, just adding an __exchange_and_add(1) inside the ctor loop will work, I think
(as that was what was done before.)

Regarding the PCH, well, I don't think it makes sense to ship a PCH that doesn't
have all the standard includes. However, that doesn't mean that build directory
testing has to use the installed PCH files: it might make sense to either

1) test without PCH
2) test with a modified PCH
3) test some test files without PCH. 

Of the three options, the third is the most appealing (since testing all without
PCH just takes too much time). I don't know how to do this however. (special
flags to pass for just these files that negates -include bits/stdc++.h? Hmm. )

-benjamin


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12855



More information about the Gcc-bugs mailing list