private void unlockEntries(Collection<GridDhtCacheEntry> locked,AffinityTopologyVersion topVer){
  assert ctx.deferredDelete() : this;
  Collection<KeyCacheObject> skip=null;
  try {
    for (    GridCacheMapEntry entry : locked) {
      if (entry != null && entry.deleted()) {
        if (skip == null)         skip=new HashSet<>(locked.size(),1.0f);
        skip.add(entry.key());
      }
    }
  }
  finally {
    for (    GridCacheMapEntry entry : locked) {
      if (entry != null)       GridUnsafe.monitorExit(entry);
    }
  }
  for (  GridDhtCacheEntry entry : locked) {
    if (entry != null)     entry.onUnlock();
  }
  if (skip != null && skip.size() == locked.size())   return;
  for (  GridCacheMapEntry entry : locked) {
    if (entry != null && (skip == null || !skip.contains(entry.key())))     ctx.evicts().touch(entry,topVer);
  }
}

private void unlockEntries ( Collection < GridDhtCacheEntry > locked , AffinityTopologyVersion topVer ) { assert ctx . deferredDelete ( ) : this ; Collection < KeyCacheObject > skip = null ; try { for ( GridCacheMapEntry entry : locked ) { if ( entry != null && entry . deleted ( ) ) { if ( skip == null ) skip = new HashSet < > ( locked . size ( ) , 1.0f ) ; skip . add ( entry . key ( ) ) ; } } } finally { for ( GridCacheMapEntry entry : locked ) { if ( entry != null ) GridUnsafe . monitorExit ( entry ) ; } } for ( GridDhtCacheEntry entry : locked ) { if ( entry != null ) entry . onUnlock ( ) ; } if ( skip != null && skip . size ( ) == locked . size ( ) ) return ; for ( GridCacheMapEntry entry : locked ) { if ( entry != null && ( skip == null || ! skip . contains ( entry . key ( ) ) ) ) ctx . evicts ( ) . touch ( entry , topVer ) ; } }
releases java - level locks on cache entries .
