This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13487] Construction of local static objects is not thread-safe
- From: "rmerkert at alphatech dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jul 2004 03:09:35 -0000
- Subject: [Bug c++/13487] Construction of local static objects is not thread-safe
- References: <20031225023132.13487.rmerkert@alphatech.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rmerkert at alphatech dot com 2004-07-05 03:09 -------
I'm glad this PR has been re-opened. This particular issue has really been
bugging me - I ended up writing a couple of macros to deal with this.
One thing to be careful about is the possibility of a thread deadlock in case
there is a cycle. It is probably best to use a recursive mutex, because it will
ensure that the program's behavior is that of a single-threaded application.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13487