X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=blobdiff_plain;f=cds%2Fcontainer%2Fellen_bintree_set_rcu.h;h=405acc9ec8fea9f11201e0fbfae63737d47e6afe;hp=96788e52c09df3eacd862d2c2058bd4e7c01fb9e;hb=1503681e52c392bee2329cf66c910be0f8640105;hpb=a2f5834b1b0611a7bb4ebf4e9f7f5838260cc747 diff --git a/cds/container/ellen_bintree_set_rcu.h b/cds/container/ellen_bintree_set_rcu.h index 96788e52..405acc9e 100644 --- a/cds/container/ellen_bintree_set_rcu.h +++ b/cds/container/ellen_bintree_set_rcu.h @@ -224,7 +224,7 @@ namespace cds { namespace container { 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. It may be passed by reference - using boost::ref + using \p std::ref RCU \p synchronize method can be called. RCU should not be locked. */ @@ -232,7 +232,7 @@ namespace cds { namespace container { bool insert( Q const& val, Func f ) { scoped_node_ptr sp( cxx_leaf_node_allocator().New( val )); - if ( base_class::insert( *sp.get(), [&f]( leaf_node& val ) { cds::unref(f)( val.m_Value ); } )) { + if ( base_class::insert( *sp.get(), [&f]( leaf_node& val ) { f( val.m_Value ); } )) { sp.release(); return true; } @@ -264,7 +264,7 @@ namespace cds { namespace container { 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 may pass \p func argument by reference using boost::ref. + You may pass \p func argument by reference using \p std::ref RCU \p synchronize method can be called. RCU should not be locked. @@ -277,7 +277,7 @@ namespace cds { namespace container { { scoped_node_ptr sp( cxx_leaf_node_allocator().New( val )); std::pair bRes = base_class::ensure( *sp, - [&func, &val](bool bNew, leaf_node& node, leaf_node&){ cds::unref(func)( bNew, node.m_Value, val ); }); + [&func, &val](bool bNew, leaf_node& node, leaf_node&){ func( bNew, node.m_Value, val ); }); if ( bRes.first && bRes.second ) sp.release(); return bRes; @@ -357,7 +357,7 @@ namespace cds { namespace container { template bool erase( Q const& key, Func f ) { - return base_class::erase( key, [&f]( leaf_node const& node) { cds::unref(f)( node.m_Value ); } ); + return base_class::erase( key, [&f]( leaf_node const& node) { f( node.m_Value ); } ); } /// Deletes the item from the set using \p pred predicate for searching @@ -371,7 +371,7 @@ namespace cds { namespace container { bool erase_with( Q const& key, Less pred, Func f ) { return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(), - [&f]( leaf_node const& node) { cds::unref(f)( node.m_Value ); } ); + [&f]( leaf_node const& node) { f( node.m_Value ); } ); } /// Extracts an item with minimal key from the set @@ -462,7 +462,7 @@ namespace cds { namespace container { \endcode where \p item is the item found, \p val is the find function argument. - You may pass \p f argument by reference using boost::ref or cds::ref. + You may pass \p f argument by reference using \p std::ref. The functor may change non-key fields of \p item. Note that the functor is only guarantee that \p item cannot be disposed during functor is executing. @@ -482,7 +482,7 @@ namespace cds { namespace container { template bool find( Q& val, Func f ) const { - return base_class::find( val, [&f]( leaf_node& node, Q& v ) { cds::unref(f)( node.m_Value, v ); }); + return base_class::find( val, [&f]( leaf_node& node, Q& v ) { f( node.m_Value, v ); }); } /// Finds the key \p val using \p pred predicate for searching @@ -496,7 +496,7 @@ namespace cds { namespace container { bool find_with( Q& val, Less pred, Func f ) const { return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(), - [&f]( leaf_node& node, Q& v ) { cds::unref(f)( node.m_Value, v ); } ); + [&f]( leaf_node& node, Q& v ) { f( node.m_Value, v ); } ); } /// Find the key \p val @@ -511,7 +511,7 @@ namespace cds { namespace container { \endcode where \p item is the item found, \p val is the find function argument. - You may pass \p f argument by reference using boost::ref or cds::ref. + You may pass \p f argument by reference using \p std::ref. The functor may change non-key fields of \p item. Note that the functor is only guarantee that \p item cannot be disposed during functor is executing. @@ -528,7 +528,7 @@ namespace cds { namespace container { template bool find( Q const& val, Func f ) const { - return base_class::find( val, [&f]( leaf_node& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); }); + return base_class::find( val, [&f]( leaf_node& node, Q const& v ) { f( node.m_Value, v ); }); } /// Finds the key \p val using \p pred predicate for searching @@ -542,7 +542,7 @@ namespace cds { namespace container { bool find_with( Q const& val, Less pred, Func f ) const { return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(), - [&f]( leaf_node& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); } ); + [&f]( leaf_node& node, Q const& v ) { f( node.m_Value, v ); } ); } /// Find the key \p val