83 |
|
|
84 |
|
List<Function<StampedLock, Long>> readLockers() { |
85 |
|
List<Function<StampedLock, Long>> readLockers = new ArrayList<>(); |
86 |
< |
readLockers.add((sl) -> sl.readLock()); |
87 |
< |
readLockers.add((sl) -> sl.tryReadLock()); |
88 |
< |
readLockers.add((sl) -> readLockInterruptiblyUninterrupted(sl)); |
89 |
< |
readLockers.add((sl) -> tryReadLockUninterrupted(sl, Long.MIN_VALUE, DAYS)); |
90 |
< |
readLockers.add((sl) -> tryReadLockUninterrupted(sl, 0L, DAYS)); |
91 |
< |
readLockers.add((sl) -> sl.tryConvertToReadLock(sl.tryOptimisticRead())); |
86 |
> |
readLockers.add(sl -> sl.readLock()); |
87 |
> |
readLockers.add(sl -> sl.tryReadLock()); |
88 |
> |
readLockers.add(sl -> readLockInterruptiblyUninterrupted(sl)); |
89 |
> |
readLockers.add(sl -> tryReadLockUninterrupted(sl, Long.MIN_VALUE, DAYS)); |
90 |
> |
readLockers.add(sl -> tryReadLockUninterrupted(sl, 0L, DAYS)); |
91 |
> |
readLockers.add(sl -> sl.tryConvertToReadLock(sl.tryOptimisticRead())); |
92 |
|
return readLockers; |
93 |
|
} |
94 |
|
|
104 |
|
|
105 |
|
List<Function<StampedLock, Long>> writeLockers() { |
106 |
|
List<Function<StampedLock, Long>> writeLockers = new ArrayList<>(); |
107 |
< |
writeLockers.add((sl) -> sl.writeLock()); |
108 |
< |
writeLockers.add((sl) -> sl.tryWriteLock()); |
109 |
< |
writeLockers.add((sl) -> writeLockInterruptiblyUninterrupted(sl)); |
110 |
< |
writeLockers.add((sl) -> tryWriteLockUninterrupted(sl, Long.MIN_VALUE, DAYS)); |
111 |
< |
writeLockers.add((sl) -> tryWriteLockUninterrupted(sl, 0L, DAYS)); |
112 |
< |
writeLockers.add((sl) -> sl.tryConvertToWriteLock(sl.tryOptimisticRead())); |
107 |
> |
writeLockers.add(sl -> sl.writeLock()); |
108 |
> |
writeLockers.add(sl -> sl.tryWriteLock()); |
109 |
> |
writeLockers.add(sl -> writeLockInterruptiblyUninterrupted(sl)); |
110 |
> |
writeLockers.add(sl -> tryWriteLockUninterrupted(sl, Long.MIN_VALUE, DAYS)); |
111 |
> |
writeLockers.add(sl -> tryWriteLockUninterrupted(sl, 0L, DAYS)); |
112 |
> |
writeLockers.add(sl -> sl.tryConvertToWriteLock(sl.tryOptimisticRead())); |
113 |
|
return writeLockers; |
114 |
|
} |
115 |
|
|