PR libstdc++/91910 fix data race in Debug Mode destructors
authorJonathan Wakely <jwakely@redhat.com>
Fri, 27 Sep 2019 16:20:40 +0000 (17:20 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 27 Sep 2019 16:20:40 +0000 (17:20 +0100)
commitf7a3a38227958558985f5f7109c3ed1dbf26832c
tree95f46a7f254a21f9609d5d6b236edcf8502dc3c2
parent88e032f105da53ef628f0eecd1f5a6fc372d022b
PR libstdc++/91910 fix data race in Debug Mode destructors

Fix data race when _Safe_iterator_base::_M_detach() runs concurrently with
the _Safe_container_base destructor.

PR libstdc++/91910
* src/c++11/debug.cc (_Safe_iterator_base::_M_detach()): Load pointer
atomically and lock the mutex before accessing the sequence.
(_Safe_local_iterator_base::_M_detach()): Likewise.
(_Safe_iterator_base::_M_reset()): Clear _M_sequence atomically.

From-SVN: r276184
libstdc++-v3/ChangeLog
libstdc++-v3/src/c++11/debug.cc