This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/12658] Thread safety problems in locale::global() and locale::locale()
- From: "rittle at latour dot rsch dot comm dot mot dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Dec 2003 07:12:05 -0000
- Subject: [Bug libstdc++/12658] Thread safety problems in locale::global() and locale::locale()
- References: <20031017095219.12658.peturr02@ru.is>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rittle at latour dot rsch dot comm dot mot dot com 2003-12-13 07:12 -------
Subject: Re: Thread safety problems in locale::global() and
locale::locale()
>------- Additional Comments From bkoz at gcc dot gnu dot org 2003-12-13
>Well......... something like this will work. It's modeled off of the glibc
>setlocale bits, and I think it will work.
>Thoughts?
>2003-12-13 Benjamin Kosnik <bkoz@redhat.com>
>
> PR libstdc++/12658
> * include/Makefile.am (bits_headers): Add concurrence.h.
> * include/Makefile.in: Regenerated.
> * include/bits/concurrence.h: New.
> * src/locale_init.cc: Use it.
> (locale::locale): Lock critical regions.
> (locale::global): Same.
It seems odd to wrap atomic updates with a mutex but it looks OK... I
must commend the improvement of adding bits/concurrence.h instead of
continuing the ad hoc style which is scattered about. - Loren
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12658