This is the mail archive of the gcc-patches@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]

~eh_globals to clear _M_init?


This is a cleanup that actually fixes the last 2 regressions found by Geoff's checker for darwin:

  libstdc++.sum 27_io/objects/char/6.cc
  libstdc++.sum 27_io/objects/wchar_t/6.cc

The code isn't technically wrong, only possibly wrong from the aesthetic perspective. This is useful on darwin, as it runs the eh_globals dtor before the cout flushing dtor (which is wrong, fixed in next OS). By doing this, we reallocate the thread key later and allow the test to pass as expected instead of delete the thread key and then trying to use it and then calling terminate because the key isn't valid.

I hate to even post this, given the details, but, I thought I'd let others make the decision...

Ok?

* libsupc++/eh_globals.cc (~__eh_globals_init): Unset _M_init.

mrs $ mkdiff libstdc++-v3
Doing diffs in libstdc++-v3:
--- libstdc++-v3/libsupc++/eh_globals.cc.~1~ 2006-01-27 14:56:21.000000000 -0800
+++ libstdc++-v3/libsupc++/eh_globals.cc 2006-07-05 19:27:15.000000000 -0700
@@ -111,6 +111,7 @@ struct __eh_globals_init
{
if (_M_init)
__gthread_key_delete(_M_key);
+ _M_init = false;
}
};


--------------


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