void link_node( node_type * pNode, node_type * pPred, node_type * pCur )
{
+ link_checker::is_empty( pNode );
assert( pPred->m_pNext.load(memory_model::memory_order_relaxed) == pCur );
pNode->m_pNext.store( pCur, memory_model::memory_order_release );
while ( pHead != &m_Tail ) {
node_type * p = pHead->m_pNext.load(memory_model::memory_order_relaxed);
dispose_node( pHead, disp );
+ --m_ItemCounter;
pHead = p;
}
}
bool insert_at( node_type * pHead, value_type& val )
{
- link_checker::is_empty( node_traits::to_node_ptr( val ) );
position pos;
key_comparator pred;
if ( !bAllowInsert )
return std::make_pair( end(), false );
- link_checker::is_empty( node_traits::to_node_ptr( val ) );
-
link_node( node_traits::to_node_ptr( val ), pos.pPred, pos.pCur );
func( true, val, val );
++m_ItemCounter;
bool insert_at( atomic_node_ptr& refHead, value_type& val )
{
- link_checker::is_empty( node_traits::to_node_ptr( val ) );
position pos;
while ( true ) {
if ( !bAllowInsert )
return std::make_pair( end(), false );
- link_checker::is_empty( node_traits::to_node_ptr( val ) );
-
if ( link_node( node_traits::to_node_ptr( val ), pos ) ) {
++m_ItemCounter;
func( true, val , val );