From: khizmax Date: Wed, 2 Dec 2015 14:21:29 +0000 (+0300) Subject: Fixed assertion in threaded uRCU X-Git-Tag: v2.1.0~47 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=75e8d34980475fa42f42d3235ddc0b846bbbf728;p=libcds.git Fixed assertion in threaded uRCU --- diff --git a/cds/urcu/details/sig_threaded.h b/cds/urcu/details/sig_threaded.h index 465700b5..e19d536a 100644 --- a/cds/urcu/details/sig_threaded.h +++ b/cds/urcu/details/sig_threaded.h @@ -77,11 +77,11 @@ namespace cds { namespace urcu { protected: //@cond - buffer_type m_Buffer; + buffer_type m_Buffer; atomics::atomic 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: @@ -208,7 +208,6 @@ namespace cds { namespace urcu { { uint64_t nPrevEpoch = m_nCurEpoch.fetch_add( 1, atomics::memory_order_release ); - atomics::atomic_thread_fence( atomics::memory_order_acquire ); { std::unique_lock sl( m_Lock ); diff --git a/cds/urcu/dispose_thread.h b/cds/urcu/dispose_thread.h index 1329af6d..5e2fc622 100644 --- a/cds/urcu/dispose_thread.h +++ b/cds/urcu/dispose_thread.h @@ -96,7 +96,7 @@ namespace cds { namespace urcu { } if ( rest.m_p ) { - assert( rest.m_nEpoch < nCurEpoch ); + assert( rest.m_nEpoch <= nCurEpoch ); rest.free(); } @@ -172,7 +172,7 @@ namespace cds { namespace urcu { /// 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.