[v3] use NSDMI in C++11 mutex types

Jonathan Wakely jwakely.gcc@gmail.com
Sat Nov 5 12:59:00 GMT 2011


Also use NSDMI for std::once_flag

        PR libstdc++/49894
        PR bootstrap/50982
        * include/std/mutex (once_flag): Use NSDMI.

tested x86_64-linux, committed to trunk.
-------------- next part --------------
Index: include/std/mutex
===================================================================
--- include/std/mutex	(revision 180749)
+++ include/std/mutex	(working copy)
@@ -760,11 +760,11 @@
   {
   private:
     typedef __gthread_once_t __native_type;
-    __native_type  _M_once;
+    __native_type  _M_once = __GTHREAD_ONCE_INIT;
 
   public:
     /// Constructor
-    constexpr once_flag() noexcept : _M_once(__GTHREAD_ONCE_INIT) { }
+    constexpr once_flag() noexcept = default;
 
     /// Deleted copy constructor
     once_flag(const once_flag&) = delete;


More information about the Libstdc++ mailing list