From: khizmax Date: Sun, 1 Nov 2015 15:34:54 +0000 (+0300) Subject: Fixed bug in MichaelLit X-Git-Tag: v2.1.0~75 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b342c3ac4f98dce911806c43727c7e880fc97dd7;p=libcds.git Fixed bug in MichaelLit --- 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; }