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

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

/*
 * Copyright © 2016 BDO-Emu authors. All rights reserved.
 * Viewing, editing, running and distribution of this software strongly prohibited.
 * Author: xTz, Anton Lasevich, Tibald
 */

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