PR c++/13684
commit4813f5af50dada66ece22c495d18a5cd6393f53b
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 28 Aug 2004 02:33:54 +0000 (28 02:33 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 28 Aug 2004 02:33:54 +0000 (28 02:33 +0000)
tree1f0fd6ce16170d90ee5ebfcb5972ed7af5874607
parent0a53b20c990bb9b0afd292d0c9fa2eb205dd1549
    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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86687 138bc75d-0d04-0410-961f-82ee72b054a4
23 files changed:
gcc/ChangeLog
gcc/c-common.c
gcc/c-common.h
gcc/c-opts.c
gcc/c.opt
gcc/config/i386/gthr-win32.c
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/tree.c
gcc/doc/invoke.texi
gcc/gimplify.c
gcc/gthr-dce.h
gcc/gthr-posix.h
gcc/gthr-single.h
gcc/gthr-solaris.h
gcc/gthr-vxworks.h
gcc/gthr-win32.h
gcc/gthr.h
gcc/tsystem.h
libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/guard.cc