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
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
Makefile.am | Loading commit data... | |
Makefile.in | Loading commit data... | |
cxxabi.h | Loading commit data... | |
del_op.cc | Loading commit data... | |
del_opnt.cc | Loading commit data... | |
del_opv.cc | Loading commit data... | |
del_opvnt.cc | Loading commit data... | |
eh_alloc.cc | Loading commit data... | |
eh_aux_runtime.cc | Loading commit data... | |
eh_catch.cc | Loading commit data... | |
eh_exception.cc | Loading commit data... | |
eh_globals.cc | Loading commit data... | |
eh_personality.cc | Loading commit data... | |
eh_term_handler.cc | Loading commit data... | |
eh_terminate.cc | Loading commit data... | |
eh_throw.cc | Loading commit data... | |
eh_type.cc | Loading commit data... | |
eh_unex_handler.cc | Loading commit data... | |
exception | Loading commit data... | |
exception_defines.h | Loading commit data... | |
guard.cc | Loading commit data... | |
new | Loading commit data... | |
new_handler.cc | Loading commit data... | |
new_op.cc | Loading commit data... | |
new_opnt.cc | Loading commit data... | |
new_opv.cc | Loading commit data... | |
new_opvnt.cc | Loading commit data... | |
pure.cc | Loading commit data... | |
tinfo.cc | Loading commit data... | |
tinfo.h | Loading commit data... | |
tinfo2.cc | Loading commit data... | |
typeinfo | Loading commit data... | |
unwind-cxx.h | Loading commit data... | |
vec.cc | Loading commit data... | |
vterminate.cc | Loading commit data... |