/** * Resets the given entry's schedule canceling any existing scheduled expiration and reordering the entry in the * internal map. Schedules the next entry in the map if the given {@code entry} was scheduled or if * {@code scheduleNext} is true. * * @param entry to reset * @param scheduleFirstEntry whether the first entry should be automatically scheduled */ void resetEntry(ExpiringEntry<K, V> entry, boolean scheduleFirstEntry) { writeLock.lock(); try { boolean scheduled = entry.cancel(); entries.reorder(entry); if (scheduled || scheduleFirstEntry) scheduleEntry(entries.first()); } finally { writeLock.unlock(); } }
/** * Resets the given entry's schedule canceling any existing scheduled expiration and reordering the entry in the * internal map. Schedules the next entry in the map if the given {@code entry} was scheduled or if * {@code scheduleNext} is true. * * @param entry to reset * @param scheduleFirstEntry whether the first entry should be automatically scheduled */ void resetEntry(ExpiringEntry<K, V> entry, boolean scheduleFirstEntry) { writeLock.lock(); try { boolean scheduled = entry.cancel(); entries.reorder(entry); if (scheduled || scheduleFirstEntry) scheduleEntry(entries.first()); } finally { writeLock.unlock(); } }
/** * Resets the given entry's schedule canceling any existing scheduled expiration and reordering the entry in the * internal map. Schedules the next entry in the map if the given {@code entry} was scheduled or if * {@code scheduleNext} is true. * * @param entry to reset * @param scheduleFirstEntry whether the first entry should be automatically scheduled */ void resetEntry(ExpiringEntry<K, V> entry, boolean scheduleFirstEntry) { writeLock.lock(); try { boolean scheduled = entry.cancel(); entries.reorder(entry); if (scheduled || scheduleFirstEntry) scheduleEntry(entries.first()); } finally { writeLock.unlock(); } }