2008-09-04 Chris Fairles <chris.fairles@gmail.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Sep 2008 14:35:54 +0000 (14:35 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Sep 2008 14:35:54 +0000 (14:35 +0000)
        * include/std/mutex (once_flag): Construct __gthread_once_t in a
temporary variable before assigning to _M_once to avoid initialization
errors.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139986 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/mutex

index c1ef36c..fa5059e 100644 (file)
@@ -1,3 +1,9 @@
+2008-09-04  Chris Fairles  <chris.fairles@gmail.com>
+
+        * 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  <paolo.carlini@oracle.com>
 
        * config/abi/pre/gnu.ver: Also export __once_functor_lock; tighten
index 5e6ba9c..e4ceaf2 100644 (file)
@@ -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;