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

net.sf.javagimmicks.concurrent.locks.MultiLock Maven / Gradle / Ivy

There is a newer version: 0.99-alpha1
Show newest version
package net.sf.javagimmicks.concurrent.locks;

import java.util.Collection;
import java.util.concurrent.locks.Lock;

/**
 * An extension of {@link Lock} that allows atomic locking on any number of
 * resources (which can be identified by resource identifiers).
 * 

* Instances can only be retrieve from a {@link MultiReadWriteLock} instance * which in turn must be generated by a {@link MultiLockProvider} (which also * takes care about resource identifier management). * * @param * The type of the internally used resource identifiers * @see MultiReadWriteLock#readLock() * @see MultiReadWriteLock#writeLock() * @see MultiLockProvider#newLock(Iterable) * @see MultiLockProvider#newLock(Object...) */ public interface MultiLock extends Lock { /** * Returns the resource identifiers with which this instance is associated. * * @return the resource identifiers with which this instance is associated. */ public Collection getResourceIds(); /** * Returns if the current {@link Thread} holds this {@link MultiLock}. * * @return if the current {@link Thread} holds this {@link MultiLock} */ public boolean isLockedByThisThread(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy