From c12a10aa9e94d2577895e87ffa2ef6bef8b4807b Mon Sep 17 00:00:00 2001 From: khizmax Date: Sun, 20 Dec 2015 11:46:46 +0300 Subject: [PATCH] Fixed false assert --- cds/intrusive/skip_list_rcu.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cds/intrusive/skip_list_rcu.h b/cds/intrusive/skip_list_rcu.h index 57d420ad..108b90b3 100644 --- a/cds/intrusive/skip_list_rcu.h +++ b/cds/intrusive/skip_list_rcu.h @@ -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 -- 2.34.1