protected:
//@cond
- buffer_type m_Buffer;
+ buffer_type m_Buffer;
atomics::atomic<uint64_t> m_nCurEpoch;
- lock_type m_Lock;
- size_t const m_nCapacity;
- disposer_thread m_DisposerThread;
+ lock_type m_Lock;
+ size_t const m_nCapacity;
+ disposer_thread m_DisposerThread;
//@endcond
public:
{
uint64_t nPrevEpoch = m_nCurEpoch.fetch_add( 1, atomics::memory_order_release );
- atomics::atomic_thread_fence( atomics::memory_order_acquire );
{
std::unique_lock<lock_type> sl( m_Lock );
}
if ( rest.m_p ) {
- assert( rest.m_nEpoch < nCurEpoch );
+ assert( rest.m_nEpoch <= nCurEpoch );
rest.free();
}
/// Start reclamation cycle
/**
This function is called by \ref general_threaded object
- to notify the reclamation thread about new work.
+ to notify the reclamation thread about a new work.
\p buf buffer contains retired objects ready to free.
The reclamation thread should free all \p buf objects
\p m_nEpoch field of which is no more than \p nCurEpoch.