# std::thread::hardware_concurrency
_ZNSt6thread20hardware_concurrencyEv;
- # __gnu_debug::_Safe_unordered_sequence_base and _Safe_local_iterator_base
- _ZN11__gnu_debug29_Safe_unordered_sequence_base7_M_swapERS0_;
- _ZN11__gnu_debug29_Safe_unordered_sequence_base13_M_detach_allEv;
+ # __gnu_debug::_Safe_unordered_container_base and _Safe_local_iterator_base
+ _ZN11__gnu_debug30_Safe_unordered_container_base7_M_swapERS0_;
+ _ZN11__gnu_debug30_Safe_unordered_container_base13_M_detach_allEv;
_ZN11__gnu_debug25_Safe_local_iterator_base9_M_attachEPNS_19_Safe_sequence_baseEb;
_ZN11__gnu_debug25_Safe_local_iterator_base9_M_detachEv;
${debug_srcdir}/safe_sequence.h \
${debug_srcdir}/safe_sequence.tcc \
${debug_srcdir}/safe_unordered_base.h \
- ${debug_srcdir}/safe_unordered_sequence.h \
- ${debug_srcdir}/safe_unordered_sequence.tcc \
+ ${debug_srcdir}/safe_unordered_container.h \
+ ${debug_srcdir}/safe_unordered_container.tcc \
${debug_srcdir}/set \
${debug_srcdir}/set.h \
${debug_srcdir}/string \
${debug_srcdir}/safe_sequence.h \
${debug_srcdir}/safe_sequence.tcc \
${debug_srcdir}/safe_unordered_base.h \
- ${debug_srcdir}/safe_unordered_sequence.h \
- ${debug_srcdir}/safe_unordered_sequence.tcc \
+ ${debug_srcdir}/safe_unordered_container.h \
+ ${debug_srcdir}/safe_unordered_container.tcc \
${debug_srcdir}/set \
${debug_srcdir}/set.h \
${debug_srcdir}/string \
-// Safe sequence/iterator base implementation -*- C++ -*-
+// Safe container/iterator base implementation -*- C++ -*-
// Copyright (C) 2011 Free Software Foundation, Inc.
//
namespace __gnu_debug
{
- class _Safe_unordered_sequence_base;
+ class _Safe_unordered_container_base;
/** \brief Basic functionality for a @a safe iterator.
*
* The %_Safe_local_iterator_base base class implements the functionality
* of a safe local iterator that is not specific to a particular iterator
- * type. It contains a pointer back to the sequence it references
+ * type. It contains a pointer back to the container it references
* along with iterator version information and pointers to form a
* doubly-linked list of local iterators referenced by the container.
*
_Safe_local_iterator_base()
{ }
- /** Initialize the iterator to reference the sequence pointed to
+ /** Initialize the iterator to reference the container pointed to
* by @p__seq. @p __constant is true when we are initializing a
* constant local iterator, and false if it is a mutable local iterator.
* Note that @p __seq may be NULL, in which case the iterator will be
_Safe_local_iterator_base(const _Safe_sequence_base* __seq, bool __constant)
{ this->_M_attach(const_cast<_Safe_sequence_base*>(__seq), __constant); }
- /** Initializes the iterator to reference the same sequence that
+ /** Initializes the iterator to reference the same container that
@p __x does. @p __constant is true if this is a constant
iterator, and false if it is mutable. */
_Safe_local_iterator_base(const _Safe_local_iterator_base& __x,
~_Safe_local_iterator_base() { this->_M_detach(); }
- _Safe_unordered_sequence_base*
- _M_get_sequence() const _GLIBCXX_NOEXCEPT;
+ _Safe_unordered_container_base*
+ _M_get_container() const _GLIBCXX_NOEXCEPT;
public:
- /** Attaches this iterator to the given sequence, detaching it
- * from whatever sequence it was attached to originally. If the
- * new sequence is the NULL pointer, the iterator is left
+ /** Attaches this iterator to the given container, detaching it
+ * from whatever container it was attached to originally. If the
+ * new container is the NULL pointer, the iterator is left
* unattached.
*/
void _M_attach(_Safe_sequence_base* __seq, bool __constant);
/** Likewise, but not thread-safe. */
void _M_attach_single(_Safe_sequence_base* __seq, bool __constant) throw ();
- /** Detach the iterator for whatever sequence it is attached to,
+ /** Detach the iterator for whatever container it is attached to,
* if any.
*/
void _M_detach();
/**
* @brief Base class that supports tracking of local iterators that
- * reference an unordered sequence.
+ * reference an unordered container.
*
- * The %_Safe_unordered_sequence_base class provides basic support for
- * tracking iterators into an unordered sequence. Sequences that track
- * iterators must derived from %_Safe_sequence_base publicly, so
+ * The %_Safe_unordered_container_base class provides basic support for
+ * tracking iterators into an unordered container. Containers that track
+ * iterators must derived from %_Safe_unordered_container_base publicly, so
* that safe iterators (which inherit _Safe_iterator_base) can
* attach to them. This class contains four linked lists of
* iterators, one for constant iterators, one for mutable
* iterators, one for constant local iterators, one for mutable local
- * iterator and a version number that allows very fast
+ * iterators and a version number that allows very fast
* invalidation of all iterators that reference the container.
*
* This class must ensure that no operation on it may throw an
- * exception, otherwise @a safe sequences may fail to provide the
+ * exception, otherwise @a safe containers may fail to provide the
* exception-safety guarantees required by the C++ standard.
*/
- class _Safe_unordered_sequence_base : public _Safe_sequence_base
+ class _Safe_unordered_container_base : public _Safe_sequence_base
{
typedef _Safe_sequence_base _Base;
public:
protected:
// Initialize with a version number of 1 and no iterators
- _Safe_unordered_sequence_base()
+ _Safe_unordered_container_base()
: _M_local_iterators(0), _M_const_local_iterators(0)
{ }
- /** Notify all iterators that reference this sequence that the
- sequence is being destroyed. */
- ~_Safe_unordered_sequence_base()
+ /** Notify all iterators that reference this container that the
+ container is being destroyed. */
+ ~_Safe_unordered_container_base()
{ this->_M_detach_all(); }
/** Detach all iterators, leaving them singular. */
void
_M_detach_all();
- /** Swap this sequence with the given sequence. This operation
+ /** Swap this container with the given container. This operation
* also swaps ownership of the iterators, so that when the
* operation is complete all iterators that originally referenced
* one container now reference the other container.
*/
void
- _M_swap(_Safe_unordered_sequence_base& __x);
+ _M_swap(_Safe_unordered_container_base& __x);
public:
- /** Attach an iterator to this sequence. */
+ /** Attach an iterator to this container. */
void
_M_attach_local(_Safe_iterator_base* __it, bool __constant);
void
_M_attach_local_single(_Safe_iterator_base* __it, bool __constant) throw ();
- /** Detach an iterator from this sequence */
+ /** Detach an iterator from this container */
void
_M_detach_local(_Safe_iterator_base* __it);
--- /dev/null
+// Safe container implementation -*- C++ -*-
+
+// Copyright (C) 2011 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/safe_unordered_container.h
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_CONTAINER_H
+#define _GLIBCXX_DEBUG_SAFE_UNORDERED_CONTAINER_H 1
+
+#include <debug/debug.h>
+#include <debug/macros.h>
+#include <debug/functions.h>
+#include <debug/safe_unordered_base.h>
+
+namespace __gnu_debug
+{
+ /**
+ * @brief Base class for constructing a @a safe unordered container type
+ * that tracks iterators that reference it.
+ *
+ * The class template %_Safe_unordered_container simplifies the
+ * construction of @a safe unordered containers that track the iterators
+ * that reference the container, so that the iterators are notified of
+ * changes in the container that may affect their operation, e.g., if
+ * the container invalidates its iterators or is destructed. This class
+ * template may only be used by deriving from it and passing the name
+ * of the derived class as its template parameter via the curiously
+ * recurring template pattern. The derived class must have @c
+ * iterator and @const_iterator types that are instantiations of
+ * class template _Safe_iterator for this container and @c local_iterator
+ * and @const_local_iterator types that are instantiations of class
+ * template _Safe_local_iterator for this container. Iterators will
+ * then be tracked automatically.
+ */
+ template<typename _Container>
+ class _Safe_unordered_container : public _Safe_unordered_container_base
+ {
+ public:
+ /** Invalidates all iterators @c x that reference this container,
+ are not singular, and for which @c pred(x) returns @c
+ true. @c pred will be invoked with the normal iterators nested
+ in the safe ones. */
+ template<typename _Predicate>
+ void
+ _M_invalidate_if(_Predicate __pred);
+
+ /** Invalidates all local iterators @c x that reference this container,
+ are not singular, and for which @c pred(x) returns @c
+ true. @c pred will be invoked with the normal ilocal iterators
+ nested in the safe ones. */
+ template<typename _Predicate>
+ void
+ _M_invalidate_local_if(_Predicate __pred);
+ };
+} // namespace __gnu_debug
+
+#include <debug/safe_unordered_container.tcc>
+
+#endif
--- /dev/null
+// Safe container implementation -*- C++ -*-
+
+// Copyright (C) 2011 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file debug/safe_unordered_container.tcc
+ * This file is a GNU debug extension to the Standard C++ Library.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_CONTAINER_TCC
+#define _GLIBCXX_DEBUG_SAFE_UNORDERED_CONTAINER_TCC 1
+
+namespace __gnu_debug
+{
+ template<typename _Container>
+ template<typename _Predicate>
+ void
+ _Safe_unordered_container<_Container>::
+ _M_invalidate_if(_Predicate __pred)
+ {
+ typedef typename _Container::iterator iterator;
+ typedef typename _Container::const_iterator const_iterator;
+
+ __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
+ for (_Safe_iterator_base* __iter = _M_iterators; __iter;)
+ {
+ iterator* __victim = static_cast<iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (!__victim->_M_singular() && __pred(__victim->base()))
+ {
+ __victim->_M_invalidate();
+ }
+ }
+
+ for (_Safe_iterator_base* __iter2 = _M_const_iterators; __iter2;)
+ {
+ const_iterator* __victim = static_cast<const_iterator*>(__iter2);
+ __iter2 = __iter2->_M_next;
+ if (!__victim->_M_singular() && __pred(__victim->base()))
+ {
+ __victim->_M_invalidate();
+ }
+ }
+ }
+
+
+ template<typename _Container>
+ template<typename _Predicate>
+ void
+ _Safe_unordered_container<_Container>::
+ _M_invalidate_local_if(_Predicate __pred)
+ {
+ typedef typename _Container::local_iterator local_iterator;
+ typedef typename _Container::const_local_iterator const_local_iterator;
+
+ __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
+ for (_Safe_iterator_base* __iter = _M_local_iterators; __iter;)
+ {
+ local_iterator* __victim = static_cast<local_iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (!__victim->_M_singular() && __pred(__victim->base()))
+ {
+ __victim->_M_invalidate();
+ }
+ }
+
+ for (_Safe_iterator_base* __iter2 = _M_const_local_iterators; __iter2;)
+ {
+ const_local_iterator* __victim =
+ static_cast<const_local_iterator*>(__iter2);
+ __iter2 = __iter2->_M_next;
+ if (!__victim->_M_singular() && __pred(__victim->base()))
+ {
+ __victim->_M_invalidate();
+ }
+ }
+ }
+
+} // namespace __gnu_debug
+
+#endif
+++ /dev/null
-// Safe sequence implementation -*- C++ -*-
-
-// Copyright (C) 2011 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file debug/safe_unordered_sequence.h
- * This file is a GNU debug extension to the Standard C++ Library.
- */
-
-#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_H
-#define _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_H 1
-
-#include <debug/debug.h>
-#include <debug/macros.h>
-#include <debug/functions.h>
-#include <debug/safe_unordered_base.h>
-
-namespace __gnu_debug
-{
- /**
- * @brief Base class for constructing a @a safe unordered sequence type
- * that tracks iterators that reference it.
- *
- * The class template %_Safe_unordered_sequence simplifies the
- * construction of @a safe unordered sequences that track the iterators
- * that reference the sequence, so that the iterators are notified of
- * changes in the sequence that may affect their operation, e.g., if
- * the container invalidates its iterators or is destructed. This class
- * template may only be used by deriving from it and passing the name
- * of the derived class as its template parameter via the curiously
- * recurring template pattern. The derived class must have @c
- * iterator and @const_iterator types that are instantiations of
- * class template _Safe_iterator for this sequence. Iterators will
- * then be tracked automatically.
- */
- template<typename _Sequence>
- class _Safe_unordered_sequence : public _Safe_unordered_sequence_base
- {
- public:
- /** Invalidates all iterators @c x that reference this sequence,
- are not singular, and for which @c pred(x) returns @c
- true. @c pred will be invoked with the normal iterators nested
- in the safe ones. */
- template<typename _Predicate>
- void
- _M_invalidate_if(_Predicate __pred);
-
- template<typename _Predicate>
- void
- _M_invalidate_local_if(_Predicate __pred);
- };
-} // namespace __gnu_debug
-
-#include <debug/safe_unordered_sequence.tcc>
-
-#endif
+++ /dev/null
-// Safe sequence implementation -*- C++ -*-
-
-// Copyright (C) 2011 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file debug/safe_unordered_sequence.tcc
- * This file is a GNU debug extension to the Standard C++ Library.
- */
-
-#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_TCC
-#define _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_TCC 1
-
-namespace __gnu_debug
-{
- template<typename _Sequence>
- template<typename _Predicate>
- void
- _Safe_unordered_sequence<_Sequence>::
- _M_invalidate_if(_Predicate __pred)
- {
- typedef typename _Sequence::iterator iterator;
- typedef typename _Sequence::const_iterator const_iterator;
-
- __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
- for (_Safe_iterator_base* __iter = _M_iterators; __iter;)
- {
- iterator* __victim = static_cast<iterator*>(__iter);
- __iter = __iter->_M_next;
- if (!__victim->_M_singular() && __pred(__victim->base()))
- {
- __victim->_M_invalidate();
- }
- }
-
- for (_Safe_iterator_base* __iter2 = _M_const_iterators; __iter2;)
- {
- const_iterator* __victim = static_cast<const_iterator*>(__iter2);
- __iter2 = __iter2->_M_next;
- if (!__victim->_M_singular() && __pred(__victim->base()))
- {
- __victim->_M_invalidate();
- }
- }
- }
-
-
- template<typename _Sequence>
- template<typename _Predicate>
- void
- _Safe_unordered_sequence<_Sequence>::
- _M_invalidate_local_if(_Predicate __pred)
- {
- typedef typename _Sequence::local_iterator local_iterator;
- typedef typename _Sequence::const_local_iterator const_local_iterator;
-
- __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex());
- for (_Safe_iterator_base* __iter = _M_local_iterators; __iter;)
- {
- local_iterator* __victim = static_cast<local_iterator*>(__iter);
- __iter = __iter->_M_next;
- if (!__victim->_M_singular() && __pred(__victim->base()))
- {
- __victim->_M_invalidate();
- }
- }
-
- for (_Safe_iterator_base* __iter2 = _M_const_local_iterators; __iter2;)
- {
- const_local_iterator* __victim =
- static_cast<const_local_iterator*>(__iter2);
- __iter2 = __iter2->_M_next;
- if (!__victim->_M_singular() && __pred(__victim->base()))
- {
- __victim->_M_invalidate();
- }
- }
- }
-
-} // namespace __gnu_debug
-
-#endif
#else
# include <unordered_map>
-#include <debug/safe_unordered_sequence.h>
+#include <debug/safe_unordered_container.h>
#include <debug/safe_iterator.h>
#include <debug/safe_local_iterator.h>
typename _Alloc = std::allocator<_Key> >
class unordered_map
: public _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>,
- public __gnu_debug::_Safe_unordered_sequence<unordered_map<_Key, _Tp,
+ public __gnu_debug::_Safe_unordered_container<unordered_map<_Key, _Tp,
_Hash, _Pred, _Alloc> >
{
typedef _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash,
_Pred, _Alloc> _Base;
- typedef __gnu_debug::_Safe_unordered_sequence<unordered_map> _Safe_base;
+ typedef __gnu_debug::_Safe_unordered_container<unordered_map> _Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
typedef typename _Base::const_local_iterator _Base_const_local_iterator;
class unordered_multimap
: public _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
_Pred, _Alloc>,
- public __gnu_debug::_Safe_unordered_sequence<unordered_multimap<_Key,
+ public __gnu_debug::_Safe_unordered_container<unordered_multimap<_Key,
_Tp, _Hash, _Pred, _Alloc> >
{
typedef _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
_Pred, _Alloc> _Base;
- typedef __gnu_debug::_Safe_unordered_sequence<unordered_multimap>
+ typedef __gnu_debug::_Safe_unordered_container<unordered_multimap>
_Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
#else
# include <unordered_set>
-#include <debug/safe_unordered_sequence.h>
+#include <debug/safe_unordered_container.h>
#include <debug/safe_iterator.h>
#include <debug/safe_local_iterator.h>
typename _Alloc = std::allocator<_Value> >
class unordered_set
: public _GLIBCXX_STD_C::unordered_set<_Value, _Hash, _Pred, _Alloc>,
- public __gnu_debug::_Safe_unordered_sequence<unordered_set<_Value, _Hash,
+ public __gnu_debug::_Safe_unordered_container<unordered_set<_Value, _Hash,
_Pred, _Alloc> >
{
typedef _GLIBCXX_STD_C::unordered_set<_Value, _Hash,
_Pred, _Alloc> _Base;
- typedef __gnu_debug::_Safe_unordered_sequence<unordered_set> _Safe_base;
+ typedef __gnu_debug::_Safe_unordered_container<unordered_set> _Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
typedef typename _Base::const_local_iterator _Base_const_local_iterator;
typename _Alloc = std::allocator<_Value> >
class unordered_multiset
: public _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash, _Pred, _Alloc>,
- public __gnu_debug::_Safe_unordered_sequence<
+ public __gnu_debug::_Safe_unordered_container<
unordered_multiset<_Value, _Hash, _Pred, _Alloc> >
{
typedef _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash,
_Pred, _Alloc> _Base;
- typedef __gnu_debug::_Safe_unordered_sequence<unordered_multiset>
+ typedef __gnu_debug::_Safe_unordered_container<unordered_multiset>
_Safe_base;
typedef typename _Base::const_iterator _Base_const_iterator;
typedef typename _Base::iterator _Base_iterator;
#include <debug/debug.h>
#include <debug/safe_sequence.h>
-#include <debug/safe_unordered_sequence.h>
+#include <debug/safe_unordered_container.h>
#include <debug/safe_iterator.h>
#include <debug/safe_local_iterator.h>
#include <algorithm>
}
void
- swap_useq(__gnu_debug::_Safe_unordered_sequence_base& __lhs,
- __gnu_debug::_Safe_unordered_sequence_base& __rhs)
+ swap_ucont(__gnu_debug::_Safe_unordered_container_base& __lhs,
+ __gnu_debug::_Safe_unordered_container_base& __rhs)
{
swap_seq(__lhs, __rhs);
swap_its(__lhs, __lhs._M_local_iterators,
" by a dereferenceable one",
"function requires a valid iterator range (%2.name;, %3.name;)"
", \"%2.name;\" shall be before and not equal to \"%3.name;\"",
- // std::unordered_sequence::local_iterator
- "attempt to compare local iterators from different unordered sequence"
+ // std::unordered_container::local_iterator
+ "attempt to compare local iterators from different unordered container"
" buckets"
};
_M_get_mutex() throw ()
{ return get_safe_base_mutex(_M_sequence); }
- _Safe_unordered_sequence_base*
+ _Safe_unordered_container_base*
_Safe_local_iterator_base::
- _M_get_sequence() const _GLIBCXX_NOEXCEPT
- { return static_cast<_Safe_unordered_sequence_base*>(_M_sequence); }
+ _M_get_container() const _GLIBCXX_NOEXCEPT
+ { return static_cast<_Safe_unordered_container_base*>(_M_sequence); }
void
_Safe_local_iterator_base::
- _M_attach(_Safe_sequence_base* __seq, bool __constant)
+ _M_attach(_Safe_sequence_base* __cont, bool __constant)
{
_M_detach();
- // Attach to the new sequence (if there is one)
- if (__seq)
+ // Attach to the new container (if there is one)
+ if (__cont)
{
- _M_sequence = __seq;
+ _M_sequence = __cont;
_M_version = _M_sequence->_M_version;
- _M_get_sequence()->_M_attach_local(this, __constant);
+ _M_get_container()->_M_attach_local(this, __constant);
}
}
void
_Safe_local_iterator_base::
- _M_attach_single(_Safe_sequence_base* __seq, bool __constant) throw ()
+ _M_attach_single(_Safe_sequence_base* __cont, bool __constant) throw ()
{
_M_detach_single();
- // Attach to the new sequence (if there is one)
- if (__seq)
+ // Attach to the new container (if there is one)
+ if (__cont)
{
- _M_sequence = __seq;
+ _M_sequence = __cont;
_M_version = _M_sequence->_M_version;
- _M_get_sequence()->_M_attach_local_single(this, __constant);
+ _M_get_container()->_M_attach_local_single(this, __constant);
}
}
_M_detach()
{
if (_M_sequence)
- _M_get_sequence()->_M_detach_local(this);
+ _M_get_container()->_M_detach_local(this);
_M_reset();
}
_M_detach_single() throw ()
{
if (_M_sequence)
- _M_get_sequence()->_M_detach_local_single(this);
+ _M_get_container()->_M_detach_local_single(this);
_M_reset();
}
void
- _Safe_unordered_sequence_base::
+ _Safe_unordered_container_base::
_M_detach_all()
{
__gnu_cxx::__scoped_lock sentry(_M_get_mutex());
}
void
- _Safe_unordered_sequence_base::
- _M_swap(_Safe_unordered_sequence_base& __x)
+ _Safe_unordered_container_base::
+ _M_swap(_Safe_unordered_container_base& __x)
{
- // We need to lock both sequences to swap
+ // We need to lock both containers to swap
using namespace __gnu_cxx;
__mutex *__this_mutex = &_M_get_mutex();
__mutex *__x_mutex = &__x._M_get_mutex();
if (__this_mutex == __x_mutex)
{
__scoped_lock __lock(*__this_mutex);
- swap_useq(*this, __x);
+ swap_ucont(*this, __x);
}
else
{
? *__this_mutex : *__x_mutex);
__scoped_lock __l2(__this_mutex < __x_mutex
? *__x_mutex : *__this_mutex);
- swap_useq(*this, __x);
+ swap_ucont(*this, __x);
}
}
void
- _Safe_unordered_sequence_base::
+ _Safe_unordered_container_base::
_M_attach_local(_Safe_iterator_base* __it, bool __constant)
{
__gnu_cxx::__scoped_lock sentry(_M_get_mutex());
}
void
- _Safe_unordered_sequence_base::
+ _Safe_unordered_container_base::
_M_attach_local_single(_Safe_iterator_base* __it, bool __constant) throw ()
{
_Safe_iterator_base*& __its =
}
void
- _Safe_unordered_sequence_base::
+ _Safe_unordered_container_base::
_M_detach_local(_Safe_iterator_base* __it)
{
- // Remove __it from this sequence's list
+ // Remove __it from this container's list
__gnu_cxx::__scoped_lock sentry(_M_get_mutex());
_M_detach_local_single(__it);
}
void
- _Safe_unordered_sequence_base::
+ _Safe_unordered_container_base::
_M_detach_local_single(_Safe_iterator_base* __it) throw ()
{
- // Remove __it from this sequence's list
+ // Remove __it from this container's list
__it->_M_unlink();
if (_M_const_local_iterators == __it)
_M_const_local_iterators = __it->_M_next;