Example usage for com.google.common.util.concurrent Striped lazyWeakReadWriteLock

List of usage examples for com.google.common.util.concurrent Striped lazyWeakReadWriteLock

Introduction

In this page you can find the example usage for com.google.common.util.concurrent Striped lazyWeakReadWriteLock.

Prototype

public static Striped<ReadWriteLock> lazyWeakReadWriteLock(int stripes) 

Source Link

Document

Creates a Striped with lazily initialized, weakly referenced read-write locks.

Usage

From source file:com.ignorelist.kassandra.steam.scraper.FileCache.java

public FileCache(Path cacheDirectory, CacheLoader<String, ? extends InputStream> valueLoader,
        long expireAfterMillis) {
    codec = new Base32();
    stripedLock = Striped.lazyWeakReadWriteLock(4 * Runtime.getRuntime().availableProcessors());
    this.cacheDirectory = cacheDirectory;
    this.valueLoader = valueLoader;
    this.expireAfterMillis = expireAfterMillis;
}