@Test public void testThreadDoesNotOwnUnlocked() { final MutuallyExclusiveSetLock<String> mutuallyExclusiveSetLock = new MutuallyExclusiveSetLock<String>(); List<String> asList = Arrays.asList("whatup", "dog"); Assert.assertTrue(!mutuallyExclusiveSetLock.isLocked(asList)); }
public boolean isLocked(Iterable<T> items) { for (T t : items) { ReentrantLock lock = syncMap.getUnchecked(t); if (!lock.isHeldByCurrentThread()) return false; } return true; }
MutuallyExclusiveSetLock { public boolean isLocked(Iterable<T> items) { for (T t : items) { ReentrantLock lock = syncMap.getUnchecked(t); if (!lock.isHeldByCurrentThread()) return false; } return true; } }
MutuallyExclusiveSetLock { public boolean isLocked(Iterable<T> items) { for (T t : items) { ReentrantLock lock = syncMap.getUnchecked(t); if (!lock.isHeldByCurrentThread()) return false; } return true; } @Deprecated  MutuallyExclusiveSetLock(); @Deprecated  MutuallyExclusiveSetLock(boolean fair); @Deprecated  MutuallyExclusiveSetLock(boolean fair, Comparator<? super T> comparator); }
MutuallyExclusiveSetLock { public boolean isLocked(Iterable<T> items) { for (T t : items) { ReentrantLock lock = syncMap.getUnchecked(t); if (!lock.isHeldByCurrentThread()) return false; } return true; } @Deprecated  MutuallyExclusiveSetLock(); @Deprecated  MutuallyExclusiveSetLock(boolean fair); @Deprecated  MutuallyExclusiveSetLock(boolean fair, Comparator<? super T> comparator); static MutuallyExclusiveSetLock<T> create(boolean fair); static MutuallyExclusiveSetLock<T> createWithComparator(boolean fair, Comparator<? super T> comparator); boolean isLocked(Iterable<T> items); LockState<T> lockOnObjects(Iterable<T> lockObjects); LockState<T> lockOnObjectsInterruptibly(Iterable<T> lockObjects); @Deprecated void unlock(LockState<T> lockState); }
MutuallyExclusiveSetLock { public boolean isLocked(Iterable<T> items) { for (T t : items) { ReentrantLock lock = syncMap.getUnchecked(t); if (!lock.isHeldByCurrentThread()) return false; } return true; } @Deprecated  MutuallyExclusiveSetLock(); @Deprecated  MutuallyExclusiveSetLock(boolean fair); @Deprecated  MutuallyExclusiveSetLock(boolean fair, Comparator<? super T> comparator); static MutuallyExclusiveSetLock<T> create(boolean fair); static MutuallyExclusiveSetLock<T> createWithComparator(boolean fair, Comparator<? super T> comparator); boolean isLocked(Iterable<T> items); LockState<T> lockOnObjects(Iterable<T> lockObjects); LockState<T> lockOnObjectsInterruptibly(Iterable<T> lockObjects); @Deprecated void unlock(LockState<T> lockState);  }