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
