Fixed false assert
authorkhizmax <libcds.dev@gmail.com>
Sun, 20 Dec 2015 08:46:46 +0000 (11:46 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sun, 20 Dec 2015 08:46:46 +0000 (11:46 +0300)
cds/intrusive/skip_list_rcu.h

index 57d420adeec52792867b329d062a6d861237fae1..108b90b37698040c3aef15c2cdb5e56bf8856fa2 100644 (file)
@@ -717,14 +717,14 @@ namespace cds { namespace intrusive {
                     if ( pSucc.bits() ) {
                         // pCur is marked, i.e. logically deleted.
                         marked_node_ptr p( pCur.ptr() );
+#                   ifdef _DEBUG
+                        if ( nLevel == 0 )
+                            pCur->m_bUnlinked = true;
+#                   endif
                         if ( pPred->next( nLevel ).compare_exchange_strong( p, marked_node_ptr( pSucc.ptr() ),
                              memory_model::memory_order_release, atomics::memory_order_relaxed ))
                         {
                             if ( nLevel == 0 ) {
-#                       ifdef _DEBUG
-                                pCur->m_bUnlinked = true;
-#                       endif
-
                                 if ( !is_extracted( pSucc )) {
                                     // We cannot free the node at this moment since RCU is locked
                                     // Link deleted nodes to a chain to free later
@@ -790,15 +790,15 @@ namespace cds { namespace intrusive {
 
                     if ( pSucc.bits() ) {
                         // pCur is marked, i.e. logically deleted.
+#                   ifdef _DEBUG
+                        if ( nLevel == 0 )
+                            pCur->m_bUnlinked = true;
+#                   endif
                         marked_node_ptr p( pCur.ptr() );
                         if ( pPred->next( nLevel ).compare_exchange_strong( p, marked_node_ptr( pSucc.ptr() ),
                             memory_model::memory_order_release, atomics::memory_order_relaxed ))
                         {
                             if ( nLevel == 0 ) {
-#                       ifdef _DEBUG
-                                pCur->m_bUnlinked = true;
-#                       endif
-
                                 if ( !is_extracted( pSucc )) {
                                     // We cannot free the node at this moment since RCU is locked
                                     // Link deleted nodes to a chain to free later
@@ -854,15 +854,15 @@ namespace cds { namespace intrusive {
 
                     if ( pSucc.bits() ) {
                         // pCur is marked, i.e. logically deleted.
+#                   ifdef _DEBUG
+                        if ( nLevel == 0 )
+                            pCur->m_bUnlinked = true;
+#                   endif
                         marked_node_ptr p( pCur.ptr() );
                         if ( pPred->next( nLevel ).compare_exchange_strong( p, marked_node_ptr( pSucc.ptr() ),
                             memory_model::memory_order_release, atomics::memory_order_relaxed ))
                         {
                             if ( nLevel == 0 ) {
-#                       ifdef _DEBUG
-                                pCur->m_bUnlinked = true;
-#                       endif
-
                                 if ( !is_extracted( pSucc )) {
                                     // We cannot free the node at this moment since RCU is locked
                                     // Link deleted nodes to a chain to free later