Package com.unboundid.util
Class CloseableReadWriteLock.ReadLock
- java.lang.Object
-
- com.unboundid.util.CloseableReadWriteLock.ReadLock
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Enclosing class:
- CloseableReadWriteLock
public final class CloseableReadWriteLock.ReadLock extends java.lang.Object implements java.io.Closeable
This class provides aCloseable
implementation that may be used to unlock aCloseableReadWriteLock
's read lock via Java's try-with-resources facility.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
avoidCompilerWarning()
This method does nothing.void
close()
Unlocks the associated lock.
-
-
-
Method Detail
-
avoidCompilerWarning
public void avoidCompilerWarning()
This method does nothing. However, calling it inside a try block when used in the try-with-resources framework can help avoid a compiler warning that the JVM will give you if you don't reference theCloseable
object inside the try block.
-
close
public void close()
Unlocks the associated lock.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-