}
}
+ /// Retires the pointer chain until \p Func returns \p nullptr retired pointer
+ template <typename Func>
+ void batch_retire( Func e )
+ {
+ retired_ptr p{ e() };
+ if ( p.m_p ) {
+ synchronize();
+ while ( p.m_p ) {
+ retired_ptr pr( p );
+ p = e();
+ pr.free();
+ }
+ }
+ }
+
/// Waits to finish a grace period
void synchronize()
{
- atomics::atomic_thread_fence( atomics::memory_order_acquire );
- {
- std::unique_lock<lock_type> sl( m_Lock );
- flip_and_wait();
- flip_and_wait();
- }
- atomics::atomic_thread_fence( atomics::memory_order_release );
+ std::unique_lock<lock_type> sl( m_Lock );
+ flip_and_wait();
+ flip_and_wait();
}
//@cond