gcc/libstdc++-v3/libsupc++
Jason Merrill 40aac94801 re PR c++/13684 (local static object variable constructed once but ctors and dtors called multiple times on same memory when called in multiple threads)
PR c++/13684
        * cp/decl.c (expand_static_init): Use thread-safety API.
        (register_dtor_fn): Return the call, don't expand it.
        * cp/tree.c (add_stmt_to_compound): New fn.
        (stabilize_call): Use it.
        * gimplify.c (gimplify_cleanup_point_expr): Handle CLEANUP_EH_ONLY.
        (gimple_push_cleanup): Add eh_only parm.
        (gimplify_target_expr): Pass it.
        * c.opt (-fno-threadsafe-statics): New option.
        * c-opts.c (c_common_handle_option): Handle it.
        * c-common.h (flag_threadsafe_statics): Declare it.
        * c-common.c (flag_threadsafe_statics): Record it.
        * doc/invoke.texi: Document it.
        * tsystem.h (_GNU_SOURCE): Define.
        * gthr-posix.h (__gthread_recursive_mutex_t): New typedef.
        (__GTHREAD_RECURSIVE_MUTEX_INIT): New macro.
        (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): New macro.
        (__gthread_recursive_mutex_init_function): New fn.
        (__gthread_recursive_mutex_lock): New fn.
        (__gthread_recursive_mutex_trylock): New fn.
        (__gthread_recursive_mutex_unlock): New fn.
        * gthr-solaris.h, gthr-single.h, gthr-dce.h: Likewise.
        * gthr-win32.h, gthr-vxworks.h: Likewise.
        * gthr.h: Document.

        * libsupc++/guard.cc (static_mutex): Internal class implementing a
        recursive mutex which controls initialization of local statics.
        (__gnu_cxx::recursive_init): New exception class.
        (__cxa_guard_acquire): Deal with locking and recursion detection.
        (acquire_1, __cxa_guard_abort, __cxa_guard_release): Likewise.

From-SVN: r86687
2004-08-27 22:33:54 -04:00
..
Makefile.am Makefile.am (hosted_source): Add libmath and testsuite. 2004-08-02 20:28:22 +00:00
Makefile.in configure.ac: Specify version 1.9.1 in AM_INIT_AUTOMAKE. 2004-08-23 10:18:31 +00:00
cxxabi.h cxxabi_tweaks.h: Define __cxa_vec_ctor_return and _GLIBCXX_CXA_VEC_CTOR_RETURN. 2004-08-12 18:50:38 +00:00
del_op.cc new_op.cc: Update comments. 2004-08-03 07:11:16 +00:00
del_opnt.cc Makefile.am, [...]: Replace "GNU CC" with "GCC". 2003-05-24 16:22:03 +00:00
del_opv.cc Makefile.am, [...]: Replace "GNU CC" with "GCC". 2003-05-24 16:22:03 +00:00
del_opvnt.cc Makefile.am, [...]: Replace "GNU CC" with "GCC". 2003-05-24 16:22:03 +00:00
eh_alloc.cc cxxabi.h: Make all declarations have default visibility. 2004-08-03 06:45:54 +00:00
eh_aux_runtime.cc cxxabi.h: Make all declarations have default visibility. 2004-08-03 06:45:54 +00:00
eh_catch.cc cxxabi.h: Make all declarations have default visibility. 2004-08-03 06:45:54 +00:00
eh_exception.cc Makefile.am, [...]: Replace "GNU CC" with "GCC". 2003-05-24 16:22:03 +00:00
eh_globals.cc cxxabi.h: Make all declarations have default visibility. 2004-08-03 06:45:54 +00:00
eh_personality.cc re PR libstdc++/5625 ([mips] exception unwinding creates invalid pointer on mips) 2004-02-09 13:20:33 -08:00
eh_term_handler.cc acinclude.m4 (GLIBCXX_ENABLE_HOSTED): #define _GLIBCXX_HOSTED appropriately. 2003-09-02 18:46:54 +00:00
eh_terminate.cc Makefile.am, [...]: Replace "GNU CC" with "GCC". 2003-05-24 16:22:03 +00:00
eh_throw.cc cxxabi.h: Make all declarations have default visibility. 2004-08-03 06:45:54 +00:00
eh_type.cc cxxabi.h: Make all declarations have default visibility. 2004-08-03 06:45:54 +00:00
eh_unex_handler.cc Makefile.am, [...]: Replace "GNU CC" with "GCC". 2003-05-24 16:22:03 +00:00
exception cxxabi.h: Make all declarations have default visibility. 2004-08-03 06:45:54 +00:00
exception_defines.h Move from CPP to CXX. 2003-07-05 04:05:45 +00:00
guard.cc re PR c++/13684 (local static object variable constructed once but ctors and dtors called multiple times on same memory when called in multiple threads) 2004-08-27 22:33:54 -04:00
new cxxabi.h: Make all declarations have default visibility. 2004-08-03 06:45:54 +00:00
new_handler.cc Makefile.am, [...]: Replace "GNU CC" with "GCC". 2003-05-24 16:22:03 +00:00
new_op.cc new_op.cc: Update comments. 2004-08-03 07:11:16 +00:00
new_opnt.cc Makefile.am, [...]: Replace "GNU CC" with "GCC". 2003-05-24 16:22:03 +00:00
new_opv.cc Makefile.am, [...]: Replace "GNU CC" with "GCC". 2003-05-24 16:22:03 +00:00
new_opvnt.cc Makefile.am, [...]: Replace "GNU CC" with "GCC". 2003-05-24 16:22:03 +00:00
pure.cc cxxabi.h: Make all declarations have default visibility. 2004-08-03 06:45:54 +00:00
tinfo.cc safe_base.h (__gnu_debug::_Safe_sequence_base): Revert -Weffc++ changes that defined copy ctory and or assignment operator. 2004-06-28 18:31:18 +00:00
tinfo.h iterator.h: Add GPL copyright info, with exception clause. 2004-05-06 22:02:05 +00:00
tinfo2.cc Makefile.am, [...]: Replace "GNU CC" with "GCC". 2003-05-24 16:22:03 +00:00
typeinfo cxxabi.h: Make all declarations have default visibility. 2004-08-03 06:45:54 +00:00
unwind-cxx.h cxxabi.h: Make all declarations have default visibility. 2004-08-03 06:45:54 +00:00
vec.cc cxxabi_tweaks.h: Define __cxa_vec_ctor_return and _GLIBCXX_CXA_VEC_CTOR_RETURN. 2004-08-12 18:50:38 +00:00
vterminate.cc Makefile.am (hosted_source): Add libmath and testsuite. 2004-08-02 20:28:22 +00:00