Merge commit '7999eaee97df27c88866d1dfd130068dba955e88' into dev
[libcds.git] / cds / intrusive / skip_list_rcu.h
index 9d74a9741feb434da30f47ad6fcf1a5bab3c9e24..d1c17cfa5d8810e2b649ffa08f8bf7d515deba93 100644 (file)
@@ -5,9 +5,9 @@
 
 #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>
@@ -543,7 +543,7 @@ namespace cds { namespace intrusive {
         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>
@@ -879,7 +879,7 @@ retry:
 #       ifdef _DEBUG
                 pNode->m_bLinked = true;
 #       endif
-                cds::unref( f )( val );
+                f( val );
             }
 
             for ( unsigned int nLevel = 1; nLevel < nHeight; ++nLevel ) {
@@ -945,7 +945,7 @@ retry:
                 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
@@ -1031,7 +1031,7 @@ retry:
                         }
                         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
@@ -1049,7 +1049,7 @@ retry:
             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
@@ -1470,7 +1470,7 @@ retry:
             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.
         */
@@ -1551,7 +1551,7 @@ retry:
             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.
 
@@ -1583,7 +1583,7 @@ retry:
                         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;
                     }
@@ -1595,7 +1595,7 @@ retry:
                             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;
                     }
@@ -1869,7 +1869,7 @@ retry:
             \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.
@@ -1913,7 +1913,7 @@ retry:
             \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.