private long elapsedNanos() { return isRunning ? ticker.read() - startTick + elapsedNanos : elapsedNanos; }
private long elapsedNanos() { return isRunning ? ticker.read() - startTick + elapsedNanos : elapsedNanos; }
/** * Returns {@code true} if the entry has expired. */ boolean isExpired(ReferenceEntry<K, V> entry) { return isExpired(entry, ticker.read()); }
/** * Starts the stopwatch. * * @return this {@code Stopwatch} instance * @throws IllegalStateException if the stopwatch is already running. */ public Stopwatch start() { checkState(!isRunning, "This stopwatch is already running."); isRunning = true; startTick = ticker.read(); return this; }
/** * Returns {@code true} if the entry has expired. */ boolean isExpired(ReferenceEntry<K, V> entry) { return isExpired(entry, ticker.read()); }
/** * Returns {@code true} if the entry has expired. */ boolean isExpired(ReferenceEntry<K, V> entry) { return isExpired(entry, ticker.read()); }
/** * Starts the stopwatch. * * @return this {@code Stopwatch} instance * @throws IllegalStateException if the stopwatch is already running. */ public Stopwatch start() { checkState(!isRunning, "This stopwatch is already running."); isRunning = true; startTick = ticker.read(); return this; }
/** * Returns {@code true} if the entry has expired. */ boolean isExpired(ReferenceEntry<K, V> entry) { return isExpired(entry, ticker.read()); }
/** * Starts the stopwatch. * * @return this {@code Stopwatch} instance * @throws IllegalStateException if the stopwatch is already running. */ public Stopwatch start() { checkState(!isRunning, "This stopwatch is already running."); isRunning = true; startTick = ticker.read(); return this; }
/** * Starts the stopwatch. * * @return this {@code Stopwatch} instance * @throws IllegalStateException if the stopwatch is already running. */ public Stopwatch start() { checkState(!isRunning, "This stopwatch is already running."); isRunning = true; startTick = ticker.read(); return this; }
void recordExpirationTime(ReferenceEntry<K, V> entry, long expirationNanos) { // might overflow, but that's okay (see isExpired()) entry.setExpirationTime(map.ticker.read() + expirationNanos); }
void recordExpirationTime(ReferenceEntry<K, V> entry, long expirationNanos) { // might overflow, but that's okay (see isExpired()) entry.setExpirationTime(map.ticker.read() + expirationNanos); }
void recordExpirationTime(ReferenceEntry<K, V> entry, long expirationNanos) { // might overflow, but that's okay (see isExpired()) entry.setExpirationTime(map.ticker.read() + expirationNanos); }
void recordExpirationTime(ReferenceEntry<K, V> entry, long expirationNanos) { // might overflow, but that's okay (see isExpired()) entry.setExpirationTime(map.ticker.read() + expirationNanos); }
void cleanUp() { long now = map.ticker.read(); runLockedCleanup(now); runUnlockedCleanup(); }
void cleanUp() { long now = map.ticker.read(); runLockedCleanup(now); runUnlockedCleanup(); }
void cleanUp() { long now = map.ticker.read(); runLockedCleanup(now); runUnlockedCleanup(); }
void cleanUp() { long now = map.ticker.read(); runLockedCleanup(now); runUnlockedCleanup(); }
boolean containsKey(Object key, int hash) { try { if (count != 0) { // read-volatile long now = map.ticker.read(); ReferenceEntry<K, V> e = getLiveEntry(key, hash, now); if (e == null) { return false; } return e.getValueReference().get() != null; } return false; } finally { postReadCleanup(); } }
boolean containsKey(Object key, int hash) { try { if (count != 0) { // read-volatile long now = map.ticker.read(); ReferenceEntry<K, V> e = getLiveEntry(key, hash, now); if (e == null) { return false; } return e.getValueReference().get() != null; } return false; } finally { postReadCleanup(); } }