int try_update_node( int nFlags, Func funcUpdate, node_type * pNode, version_type nVersion, rcu_disposer& disp )
{
mapped_type pOld;
+ bool bInserted;
assert( pNode != nullptr );
{
node_scoped_lock l( m_Monitor, *pNode );
}
pOld = pNode->value( memory_model::memory_order_relaxed );
+ bInserted = pOld == nullptr;
mapped_type pVal = funcUpdate( pNode );
if ( pVal == pOld )
pOld = nullptr;
m_stat.onDisposeValue();
}
+ if ( bInserted ) {
+ m_stat.onInsertSuccess();
+ return update_flags::result_inserted;
+ }
+
m_stat.onUpdateSuccess();
return update_flags::result_updated;
}