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

Submitted by Jonathan Wakely on Nov. 5, 2011, 12:59 p.m.

Details

Message ID CAH6eHdQs90gH-0OBGHxwNO+SsOTmWCgmxwdXkkM7_v60oXHMgQ@mail.gmail.com
State New
Headers show

Commit Message

Jonathan Wakely Nov. 5, 2011, 12:59 p.m.
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.

Patch hide | download patch | download mbox

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;