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

com.softicar.platform.common.core.thread.Locker Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.core.thread;

import java.util.concurrent.locks.Lock;

/**
 * An {@link AutoCloseable} to lock a {@link Lock}.
 * 

* Use this in a try-with-resource. * * @author Oliver Richers */ public class Locker implements AutoCloseable { private final Lock lock; public Locker(Lock lock) { this.lock = lock; lock.lock(); } @Override public void close() { lock.unlock(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy