This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: [RFC] 12658_thread.cc randomly fails (on MP machines)


Nathan Myers wrote:

I just looked at the PR for the first time. What a load of nonsense!
There's no need for mutexes anywhere.


It would suffice to add calls to add_reference and remove_reference to keep anything from disappearing too early.

Hi Nathan. Indeed, I had hopes but haven't been able to figure out
something really working in every circumstance.

Consider the simplest case

 locale::locale() throw() : _M_impl(0)
 {
   _S_initialize();
   __gnu_cxx::lock sentry(__gnu_internal::locale_cons_mutex);
   _S_global->_M_add_reference();
   _M_impl = _S_global;
 }

together with the original report ( 2) ) + Comment #14: how can you
possibly deal with those patterns??

Thanks,
Paolo.


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