This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/12855] Thread safety problems in ios_base::Init
- From: "bkoz at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Dec 2003 06:42:04 -0000
- Subject: [Bug libstdc++/12855] Thread safety problems in ios_base::Init
- References: <20031031094301.12855.peturr02@ru.is>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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