pulate protected state } finally { lock.unlock(); } } else { // perform alternative actions }} This usage ensures that the lock is unlocked if it was acquired, and doesn't try to unlock if the lock was not acquired.
@return {@code true} if the lock was acquired and{@code false} otherwise
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.