This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/12658] Thread safety problems in locale::global() and locale::locale()


------- Additional Comments From pcarlini at unitus dot it  2003-12-13 08:55 -------
Subject: Re:  Thread safety problems in locale::global()
 and locale::locale()

bkoz at gcc dot gnu dot org wrote:

>------- Additional Comments From bkoz at gcc dot gnu dot org  2003-12-13 06:35 -------
>
>Well......... something like this will work. It's modeled off of the glibc
>setlocale bits, and I think it will work. 
>
>Thoughts?
>  
>
Probably, for locale::global() a lock is really needed, I agree with you.
However, for this

>    locale::locale() throw()
>    { 
>      _S_initialize(); 
>!     (_M_impl = _S_global)->_M_add_reference(); 
>    }
>  
>
Are you really sure that the trivial rearrangement that I proposed 
doesn't suffice?
It appears to answer Pétur's analysis...

Paolo.



-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]