#include <type_traits>
#include <memory>
-#include <cds/intrusive/skip_list_base.h>
+#include <functional> // ref
+#include <cds/intrusive/details/skip_list_base.h>
#include <cds/opt/compare.h>
-#include <cds/ref.h>
#include <cds/urcu/details/check_deadlock.h>
#include <cds/details/binary_functor_wrapper.h>
#include <cds/urcu/exempt_ptr.h>
typedef typename options::stat stat ; ///< internal statistics type
typedef typename options::rcu_check_deadlock rcu_check_deadlock ; ///< Deadlock checking policy
typedef typename gc::scoped_lock rcu_lock ; ///< RCU scoped lock
- static CDS_CONSTEXPR_CONST bool c_bExtractLockExternal = false; ///< Group of \p extract_xxx functions does not require external locking
+ static CDS_CONSTEXPR const bool c_bExtractLockExternal = false; ///< Group of \p extract_xxx functions does not require external locking
/// Max node height. The actual node height should be in range <tt>[0 .. c_nMaxHeight)</tt>
# ifdef _DEBUG
pNode->m_bLinked = true;
# endif
- cds::unref( f )( val );
+ f( val );
}
for ( unsigned int nLevel = 1; nLevel < nHeight; ++nLevel ) {
int const nMask = bExtract ? 3 : 1;
if ( pDel->next(0).compare_exchange_strong( pSucc, pSucc | nMask, memory_model::memory_order_acquire, atomics::memory_order_relaxed ))
{
- cds::unref(f)( *node_traits::to_value_ptr( pDel ));
+ f( *node_traits::to_value_ptr( pDel ));
// physical deletion
// try fast erase
}
else if ( nCmp == 0 ) {
// found
- cds::unref(f)( *node_traits::to_value_ptr( pCur.ptr() ), val );
+ f( *node_traits::to_value_ptr( pCur.ptr() ), val );
return find_fastpath_found;
}
else // pCur > val - go down
if ( find_position( val, pos, cmp, true )) {
assert( cmp( *node_traits::to_value_ptr( pos.pCur ), val ) == 0 );
- cds::unref(f)( *node_traits::to_value_ptr( pos.pCur ), val );
+ f( *node_traits::to_value_ptr( pos.pCur ), val );
return true;
}
else
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 set'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.
RCU \p synchronize method can be called. RCU should not be locked.
*/
The functor can 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.
RCU \p synchronize method can be called. RCU should not be locked.
if ( !bTowerMade )
scp.release();
- cds::unref(func)( false, *node_traits::to_value_ptr(pos.pCur), val );
+ func( false, *node_traits::to_value_ptr(pos.pCur), val );
m_Stat.onEnsureExist();
break;
}
bTowerOk = true;
}
- if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { cds::unref(func)( true, item, item ); })) {
+ if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { func( true, item, item ); })) {
m_Stat.onInsertRetry();
continue;
}
\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. Note that the functor is only guarantee
that \p item cannot be disposed during functor is executing.
\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. Note that the functor is only guarantee
that \p item cannot be disposed during functor is executing.