All Downloads are FREE. Search and download functionalities are using the official Maven repository.

host.anzo.commons.concurrent.CloseableReentrantLock Maven / Gradle / Ivy

There is a newer version: 1.29
Show newest version
package host.anzo.commons.concurrent;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @author tsa
 * @since 20.11.2016
 */
public class CloseableReentrantLock extends ReentrantLock implements AutoCloseable {
	public CloseableReentrantLock() {
		super(true);
	}

	public CloseableReentrantLock open() {
		this.lock();
		return this;
	}

	@Override
	public void close() {
		this.unlock();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy