From b342c3ac4f98dce911806c43727c7e880fc97dd7 Mon Sep 17 00:00:00 2001 From: khizmax Date: Sun, 1 Nov 2015 18:34:54 +0300 Subject: [PATCH] Fixed bug in MichaelLit --- cds/intrusive/michael_list_rcu.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cds/intrusive/michael_list_rcu.h b/cds/intrusive/michael_list_rcu.h index 4fd6f839..b77cc9e8 100644 --- a/cds/intrusive/michael_list_rcu.h +++ b/cds/intrusive/michael_list_rcu.h @@ -957,18 +957,21 @@ namespace cds { namespace intrusive { back_off bkoff; check_deadlock_policy::check(); + node_type * pDel; for (;;) { { rcu_lock l; if ( !search( pos.refHead, val, pos, cmp ) ) return false; + // store pCur since it may be changed by unlink_node() slow path + pDel = pos.pCur; if ( !unlink_node( pos, erase_mask )) { bkoff(); continue; } } - - f( *node_traits::to_value_ptr( *pos.pCur ) ); + assert( pDel ); + f( *node_traits::to_value_ptr( pDel ) ); --m_ItemCounter; return true; } -- 2.34.1