[Bug libstdc++/12658] Thread safety problems in locale::global() and locale::locale()
rittle at latour dot rsch dot comm dot mot dot com
gcc-bugzilla@gcc.gnu.org
Sat Dec 13 07:12:00 GMT 2003
------- 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
More information about the Gcc-bugs
mailing list