/** * {@inheritDoc} */ public long delete(long sizeOf) throws IllegalArgumentException { checkLinked(); // if (sizeOf < 0L) { // throw new IllegalArgumentException("cannot delete negative size"); // } // synchronized makes the size update MT-safe but slow lock.lock(); try { size -= sizeOf; } finally { lock.unlock(); } return sizeOf; }
/** * {@inheritDoc} */ public long delete(long sizeOf) { checkLinked(); // synchronized makes the size update MT-safe but slow lock.lock(); try { size -= sizeOf; } finally { lock.unlock(); } return sizeOf; }
/** * {@inheritDoc} */ public long delete(long sizeOf) throws IllegalArgumentException { checkLinked(); // if (sizeOf < 0L) { // throw new IllegalArgumentException("cannot delete negative size"); // } // synchronized makes the size update MT-safe but slow lock.lock(); try { size -= sizeOf; } finally { lock.unlock(); } return sizeOf; }
/** * {@inheritDoc} */ public long delete(long sizeOf) throws IllegalArgumentException { checkLinked(); // if (sizeOf < 0L) { // throw new IllegalArgumentException("cannot delete negative size"); // } // synchronized makes the size update MT-safe but slow lock.lock(); try { size -= sizeOf; } finally { lock.unlock(); } return sizeOf; }