Fixed assertion in threaded uRCU
authorkhizmax <khizmax@gmail.com>
Wed, 2 Dec 2015 14:21:29 +0000 (17:21 +0300)
committerkhizmax <khizmax@gmail.com>
Wed, 2 Dec 2015 14:21:29 +0000 (17:21 +0300)
cds/urcu/details/sig_threaded.h
cds/urcu/dispose_thread.h

index 465700b5deb0e2a79dbe7a49c039b7326fb427ab..e19d536a5cc5b42a957dc45abc5b5bc826eca1b9 100644 (file)
@@ -77,11 +77,11 @@ namespace cds { namespace urcu {
 
     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:
@@ -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<lock_type> sl( m_Lock );
 
index 1329af6d0f69980610f3f77e84a1669f66d5ccd8..5e2fc622d1060411fff3678b69815281aa2b55c1 100644 (file)
@@ -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 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.