org.infinispan.util.concurrent.locks.containers.OwnableReentrantStripedLockContainer Maven / Gradle / Ivy
package org.infinispan.util.concurrent.locks.containers;
import net.jcip.annotations.ThreadSafe;
import org.infinispan.commons.equivalence.Equivalence;
import org.infinispan.util.concurrent.locks.OwnableReentrantLock;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
/**
* A LockContainer that holds {@link org.infinispan.util.concurrent.locks.OwnableReentrantLock}s.
*
* @author Manik Surtani ([email protected])
* @see ReentrantStripedLockContainer
* @see org.infinispan.util.concurrent.locks.OwnableReentrantLock
* @since 4.0
*/
@ThreadSafe
public class OwnableReentrantStripedLockContainer extends AbstractStripedLockContainer {
private final OwnableReentrantLock[] sharedLocks;
private static final Log log = LogFactory.getLog(OwnableReentrantStripedLockContainer.class);
@Override
protected Log getLog() {
return log;
}
/**
* Creates a new LockContainer which uses a certain number of shared locks across all elements that need to be
* locked.
*
* @param concurrencyLevel concurrency level for number of stripes to create. Stripes are created in powers of two,
* with a minimum of concurrencyLevel created.
*/
public OwnableReentrantStripedLockContainer(int concurrencyLevel, Equivalence
© 2015 - 2025 Weber Informatics LLC | Privacy Policy