246247248249250251252253254255256
setTimeAt(entry); return; } } } finally { lock.unlockRead(); } } public Record<K, V> lockRecordForRead(K key) { long hashCode = hashCode(key);
263264265266267268269270271272273
if (isExpired(entry)) break; return new Record<K, V>(this, lock, entry); } } lock.unlockRead(); return null; } public WritableRecord<K, V> lockRecordForWrite(K key, boolean create) { long hashCode = hashCode(key);
374375376377378379380381382383384
try { for (long entry; (entry = unsafe.getAddress(currentPtr)) != 0; currentPtr = entry + NEXT_OFFSET) { visitor.visit(new Record<K, V>(this, lock, entry)); } } finally { lock.unlockRead(); } } } public void iterate(WritableVisitor<K, V> visitor) {
654655656657658659660661662663664
timestamps[samples++] = unsafe.getLong(entry + TIME_OFFSET); if (samples == timestamps.length) return samples; } } } finally { lock.unlockRead(); } bucket = (bucket + 1) & (CONCURRENCY_LEVEL - 1); } while (bucket != startBucket); return samples;
138139140141142143144145146147148
if (unsafe.getLong(entry + HASH_OFFSET) == hashCode && equalsAt(entry, key)) { return isExpired(entry) ? null : valueAt(entry); } } } finally { lock.unlockRead(); } return null; }