> -----Original Message----- > From: Travis Vitek [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 03, 2008 1:05 PM > To: dev@stdcxx.apache.org > Subject: RE: svn commit: r644364 - in /stdcxx/trunk: > src/locale_global.cpp tests/localization/22.locale.statics.mt.cpp > > > > >Eric Lemings wrote: > > > >Please peer review the following patch at your earliest convenience. > > > > Brad, > > I don't think that this patch is going to work. The > unnecessary changes > to the __rw_setlocale ctor and dtor will cause new failures. > > The __rw_setlocale type is supposed to hold the lock for its > lifetime to > prevent other __rw_setlocale instances from being created and changing > the locale. Your change prevents concurrent calls to > setlocale() through > __rw_setlocale() instances, but it doesn't prevent multiple > __rw_setlocale instances from existing simultaneously.
So if thread A creates one of these objects, thread B can't change the global locale until thread A destroys the __rw_setlocale object? That's some lengthy syncronization but if the code depends on it... Will fix according to Martin's suggestion to expose the mutex. Brad.