Fix lifetime of mutex lock in debug iterator

* include/debug/safe_iterator.h (_Safe_iterator::operator++()): Fix
	lifetime of lock.

From-SVN: r240549
This commit is contained in:
Jonathan Wakely 2016-09-27 16:37:44 +01:00 committed by Jonathan Wakely
parent 1dee0646ff
commit a424a3cb04
2 changed files with 6 additions and 1 deletions

View 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__)

View 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;
}