public void remove(RegionEntry entry,Object value){
  Object object=map.get(entry);
  if (object == null)   return;
  if (object instanceof Collection) {
    Collection coll=(Collection)object;
    boolean removed=false;
    if (useList) {
synchronized (coll) {
        removed=coll.remove(value);
      }
    }
 else {
      removed=coll.remove(value);
    }
    if (removed) {
      if (coll.size() == 0) {
        map.remove(entry);
      }
      atomicUpdater.decrementAndGet(this);
    }
  }
 else {
    if (object.equals(value)) {
      map.remove(entry);
    }
    atomicUpdater.decrementAndGet(this);
  }
}

public void remove ( RegionEntry entry , Object value ) { Object object = map . get ( entry ) ; if ( object == null ) return ; if ( object instanceof Collection ) { Collection coll = ( Collection ) object ; boolean removed = false ; if ( useList ) { synchronized ( coll ) { removed = coll . remove ( value ) ; } } else { removed = coll . remove ( value ) ; } if ( removed ) { if ( coll . size ( ) == 0 ) { map . remove ( entry ) ; } atomicUpdater . decrementAndGet ( this ) ; } } else { if ( object . equals ( value ) ) { map . remove ( entry ) ; } atomicUpdater . decrementAndGet ( this ) ; } }
we do not use any locks here as every remove is for a regionentry which is locked before coming here . no two threads can be entering in this method together for a regionentry .
