/** * Decrements the reference counting of this object. When reference counting * hits 0, calls {@link #release()}. */ public final void decRef() throws IOException { final int rc = refCount.decrementAndGet(); if (rc == 0) { boolean success = false; try { release(); success = true; } finally { if (!success) { // Put reference back on failure refCount.incrementAndGet(); } } } else if (rc < 0) { throw new IllegalStateException("too many decRef calls: refCount is " + rc + " after decrement"); } }
/** * Decrements the reference counting of this object. When reference counting * hits 0, calls {@link #release()}. */ public final void decRef() throws IOException { final int rc = refCount.decrementAndGet(); if (rc == 0) { boolean success = false; try { release(); success = true; } finally { if (!success) { // Put reference back on failure refCount.incrementAndGet(); } } } else if (rc < 0) { throw new IllegalStateException("too many decRef calls: refCount is " + rc + " after decrement"); } }
/** * Decrements the reference counting of this object. When reference counting * hits 0, calls {@link #release()}. */ public final void decRef() throws IOException { final int rc = refCount.decrementAndGet(); if (rc == 0) { boolean success = false; try { release(); success = true; } finally { if (!success) { // Put reference back on failure refCount.incrementAndGet(); } } } else if (rc < 0) { throw new IllegalStateException("too many decRef calls: refCount is " + rc + " after decrement"); } }
/** * Decrements the reference counting of this object. When reference counting * hits 0, calls {@link #release()}. */ public final void decRef() throws IOException { final int rc = refCount.decrementAndGet(); if (rc == 0) { boolean success = false; try { release(); success = true; } finally { if (!success) { // Put reference back on failure refCount.incrementAndGet(); } } } else if (rc < 0) { throw new IllegalStateException("too many decRef calls: refCount is " + rc + " after decrement"); } }