protected boolean removeEntry(Entry e) {
    int hc = extractModifiedHash(e);
    boolean _removed;
    OptimisticLock l = hash.getSegmentLock(hc);
    long _stamp = l.writeLock();
    try {
      _removed = hash.removeWithinLock(e, hc);
      e.setGone();
      if (_removed) {
        eviction.submitWithoutEviction(e);
      }
    } finally {
      l.unlockWrite(_stamp);
    }
    checkForHashCodeChange(e);
    timing.cancelExpiryTimer(e);
    return _removed;
  }
protected boolean removeEntry ( Entry e ) { int hc = extractModifiedHash ( e ) ; boolean _removed ; OptimisticLock l = hash . getSegmentLock ( hc ) ; long _stamp = l . writeLock ( ) ; try { _removed = hash . removeWithinLock ( e , hc ) ; e . setGone ( ) ; if ( _removed ) { eviction . submitWithoutEviction ( e ) ; } } finally { l . unlockWrite ( _stamp ) ; } checkForHashCodeChange ( e ) ; timing . cancelExpiryTimer ( e ) ; return _removed ; }
Remove the entry from the hash and the replacement list.
There is a race condition to catch: The eviction may run
in a parallel thread and may have already selected this
entry.