where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
\p val no any other changes could be made on this list's item by concurrent threads.
The user-defined functor is called only if the inserting is success and may be passed by reference
- using <tt>boost::ref</tt>.
+ using \p std::ref.
The function makes RCU lock internally.
*/
The functor may change non-key fields of the \p item; however, \p func must guarantee
that during changing no any other modifications could be made on this item by concurrent threads.
- You can pass \p func argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+ You can pass \p func argument by value or by reference using \p std::ref.
Returns <tt> std::pair<bool, bool> </tt> where \p first is true if operation is successfull,
\p second is true if new item has been added or \p false if the item with \p key
\endcode
where \p item is the item found, \p val is the <tt>find</tt> function argument.
- You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+ You can pass \p f argument by value or by reference using \p std::ref.
The functor can change non-key fields of \p item.
The function \p find does not serialize simultaneous access to the list \p item. If such access is
\endcode
where \p item is the item found, \p val is the <tt>find</tt> function argument.
- You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+ You can pass \p f argument by value or by reference using \p std::ref.
The functor can change non-key fields of \p item.
The function \p find does not serialize simultaneous access to the list \p item. If such access is
return false;
if ( link_node( node_traits::to_node_ptr( val ), pos ) ) {
- cds::unref(f)( val );
+ f( val );
++m_ItemCounter;
return true;
}
if ( search( refHead, val, pos, key_comparator() ) ) {
assert( key_comparator()( val, *node_traits::to_value_ptr( *pos.pCur ) ) == 0 );
- unref(func)( false, *node_traits::to_value_ptr( *pos.pCur ), val );
+ func( false, *node_traits::to_value_ptr( *pos.pCur ), val );
return std::make_pair( iterator( pos.pCur ), false );
}
else {
if ( link_node( node_traits::to_node_ptr( val ), pos ) ) {
++m_ItemCounter;
- unref(func)( true, val , val );
+ func( true, val , val );
return std::make_pair( iterator( node_traits::to_node_ptr( val )), true );
}
}
}
- cds::unref(f)( *node_traits::to_value_ptr( *pos.pCur ) );
+ f( *node_traits::to_value_ptr( *pos.pCur ) );
--m_ItemCounter;
dispose_node( pos.pCur );
return true;
rcu_lock l( bLock );
if ( search( refHead, val, pos, cmp ) ) {
assert( pos.pCur != nullptr );
- unref(f)( *node_traits::to_value_ptr( *pos.pCur ), val );
+ f( *node_traits::to_value_ptr( *pos.pCur ), val );
return true;
}
return false;