#ifndef __CDS_INTRUSIVE_SPLIT_LIST_RCU_H
#define __CDS_INTRUSIVE_SPLIT_LIST_RCU_H
-#include <cds/intrusive/split_list_base.h>
+#include <cds/intrusive/details/split_list_base.h>
#include <cds/details/binary_functor_wrapper.h>
namespace cds { namespace intrusive {
protected:
ordered_list_wrapper m_List ; ///< Ordered list containing split-list items
bucket_table m_Buckets ; ///< bucket table
- CDS_ATOMIC::atomic<size_t> m_nBucketCountLog2 ; ///< log2( current bucket count )
+ atomics::atomic<size_t> m_nBucketCountLog2 ; ///< log2( current bucket count )
item_counter m_ItemCounter ; ///< Item counter
hash m_HashFunctor ; ///< Hash functor
size_t bucket_no( size_t nHash ) const
{
- return nHash & ( (1 << m_nBucketCountLog2.load(CDS_ATOMIC::memory_order_relaxed)) - 1 );
+ return nHash & ( (1 << m_nBucketCountLog2.load(atomics::memory_order_relaxed)) - 1 );
}
static size_t parent_bucket( size_t nBucket )
void inc_item_count()
{
- size_t sz = m_nBucketCountLog2.load(CDS_ATOMIC::memory_order_relaxed);
+ size_t sz = m_nBucketCountLog2.load(atomics::memory_order_relaxed);
if ( ( ++m_ItemCounter >> sz ) > m_Buckets.load_factor() && ((size_t)(1 << sz )) < m_Buckets.capacity() )
{
- m_nBucketCountLog2.compare_exchange_strong( sz, sz + 1, CDS_ATOMIC::memory_order_seq_cst, CDS_ATOMIC::memory_order_relaxed );
+ m_nBucketCountLog2.compare_exchange_strong( sz, sz + 1, atomics::memory_order_seq_cst, atomics::memory_order_relaxed );
}
}
dummy_node_type * pHead = get_bucket( nHash );
assert( pHead != nullptr );
-# ifdef CDS_CXX11_LAMBDA_SUPPORT
return m_List.find_at( pHead, sv, cmp,
- [&f](value_type& item, split_list::details::search_value_type<Q>& val){ cds::unref(f)(item, val.val ); });
-# else
- split_list::details::find_functor_wrapper<Func> ffw( f );
- return m_List.find_at( pHead, sv, cmp, cds::ref(ffw) );
-# endif
+ [&f](value_type& item, split_list::details::search_value_type<Q>& val){ f(item, val.val ); });
}
template <typename Q, typename Compare>
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.
The function makes RCU lock internally.
*/
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.
The function makes RCU lock internally.
\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.