]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix lifetime of mutex lock in debug iterator
authorJonathan Wakely <jwakely@redhat.com>
Tue, 27 Sep 2016 15:37:44 +0000 (16:37 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 27 Sep 2016 15:37:44 +0000 (16:37 +0100)
* include/debug/safe_iterator.h (_Safe_iterator::operator++()): Fix
lifetime of lock.

From-SVN: r240549

libstdc++-v3/ChangeLog
libstdc++-v3/include/debug/safe_iterator.h

index 80ca177e7dc4c98695b866ceb1cd9f2083fe45a8..4a20ad942f5f661913befe81441bf894a9d8f437 100644 (file)
@@ -1,3 +1,8 @@
+2016-09-27  Jonathan Wakely  <jwakely@redhat.com>
+
+       * include/debug/safe_iterator.h (_Safe_iterator::operator++()): Fix
+       lifetime of lock.
+
 2016-09-20  Jonathan Wakely  <jwakely@redhat.com>
 
        * python/libstdcxx/v6/xmethods.py (DequeWorkerBase.__init__)
index 1eea238b97acb65f889b40747ca098c74465e59f..6e3113ae424423e15662640dd9cabfef2f86cf94 100644 (file)
@@ -329,7 +329,7 @@ namespace __gnu_debug
        _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(),
                              _M_message(__msg_bad_inc)
                              ._M_iterator(*this, "this"));
-       __gnu_cxx::__scoped_lock(this->_M_get_mutex());
+       __gnu_cxx::__scoped_lock __l(this->_M_get_mutex());
        ++base();
        return *this;
       }