privatize_result privatize() CDS_NOEXCEPT
{
privatize_result res;
- res.first = m_pHead.exchange( nullptr, atomics::memory_order_acq_rel );
// Item counter is needed only as a threshold for \p scan() function
// So, we may clear the item counter without synchronization with m_pHead
res.second = m_nItemCount.exchange( 0, atomics::memory_order_relaxed );
+
+ res.first = m_pHead.exchange( nullptr, atomics::memory_order_acq_rel );
+
return res;
}
size_t const m_nBucketCount;
item_type * m_Buckets;
- item_type& bucket( retired_ptr_node& node )
+ item_type& bucket( retired_ptr_node& node ) const
{
return bucket( node.m_ptr.m_p );
}
- item_type& bucket( guard_data::guarded_ptr p )
+ item_type& bucket( guard_data::guarded_ptr p ) const
{
return m_Buckets[ std::hash<guard_data::guarded_ptr>()( p ) & (m_nBucketCount - 1) ];
}