Fixed cache locks as they were swapped.
Must've been real tired or something while writing that.
This commit is contained in:
parent
3675074d00
commit
250334e348
@ -11,8 +11,8 @@ public class Cache<Key, Value> {
|
|||||||
private final ConcurrentHashMap<Key, CacheValue<Value>> data;
|
private final ConcurrentHashMap<Key, CacheValue<Value>> data;
|
||||||
private final ConcurrentLinkedQueue<Key> occurrenceOrder;
|
private final ConcurrentLinkedQueue<Key> occurrenceOrder;
|
||||||
private ReentrantReadWriteLock cleaningLock = new ReentrantReadWriteLock(true);
|
private ReentrantReadWriteLock cleaningLock = new ReentrantReadWriteLock(true);
|
||||||
private ReadLock writeLock = cleaningLock.readLock();
|
private WriteLock writeLock = cleaningLock.writeLock();
|
||||||
private WriteLock readLock = cleaningLock.writeLock();
|
private ReadLock readLock = cleaningLock.readLock();
|
||||||
|
|
||||||
public Cache(int maxSize) {
|
public Cache(int maxSize) {
|
||||||
data = new ConcurrentHashMap<>(maxSize + 1, 0.75f, 6);
|
data = new ConcurrentHashMap<>(maxSize + 1, 0.75f, 6);
|
||||||
|
Loading…
Reference in New Issue
Block a user