incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <Travis.Vi...@roguewave.com>
Subject RE: svn commit: r644364 - in /stdcxx/trunk: src/locale_global.cpp tests/localization/22.locale.statics.mt.cpp
Date Thu, 03 Apr 2008 17:29:37 GMT
 

Eric Lemings wrote:
>
>
>file src/setlocale.cpp:
> 83     // acquire global per-process lock
> 84     __rw_setlocale_mutex._C_acquire ();
> 85
> 86     // retrieve previous locale name and check if it is already set
> 87     const char* const curname = ::setlocale (cat, 0);
>
>The mutex doesn't need to be locked just to read the current
>locale name, does it? 
>

According to the documentation on Solaris, it does not...

  Using setlocale() to query the current locale is safe
  and can be used anywhere in a multithreaded application.

I haven't seen any documentation on any of the other platforms to
indicate that it is safe, I'd say it is safest to always lock.

Travis



Mime
View raw message