From: Chris Fairles Date: Thu, 4 Sep 2008 14:35:54 +0000 (+0000) Subject: mutex (once_flag): Construct __gthread_once_t in a temporary variable before assignin... X-Git-Tag: releases/gcc-4.4.0~2644 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d74eef3beb52d29c497e24e9b26d8ff83946793d;p=thirdparty%2Fgcc.git mutex (once_flag): Construct __gthread_once_t in a temporary variable before assigning to _M_once... 2008-09-04 Chris Fairles * include/std/mutex (once_flag): Construct __gthread_once_t in a temporary variable before assigning to _M_once to avoid initialization errors. From-SVN: r139986 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c1ef36c5ba8b..fa5059e25e8d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2008-09-04 Chris Fairles + + * include/std/mutex (once_flag): Construct __gthread_once_t in a + temporary variable before assigning to _M_once to avoid initialization + errors. + 2008-09-03 Paolo Carlini * config/abi/pre/gnu.ver: Also export __once_functor_lock; tighten diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index 5e6ba9c27155..e4ceaf2aac89 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -615,8 +615,10 @@ namespace std typedef __gthread_once_t __native_type; once_flag() - : _M_once(__GTHREAD_ONCE_INIT) - { } + { + __gthread_once_t __tmp = __GTHREAD_ONCE_INIT; + _M_once = __tmp; + } once_flag(const once_flag&) = delete; once_flag& operator=(const once_flag&) = delete;