// TODO May be possible to do finer-grained locks.
private void trackWatchForAttempt(WatchedPathInfo watchedPathInfo, WatchKey watchKey) {
    assert watchedPathInfo.pathIdentifier != null;
    // TODO May be possible to do finer-grained locks.
    synchronized (watchesPerAttempt) {
      List<WatchKey> list = watchesPerAttempt.get(watchedPathInfo.pathIdentifier);
      if (list == null) {
        list = new LinkedList<>();
        watchesPerAttempt.put(watchedPathInfo.pathIdentifier, list);
      }
      list.add(watchKey);
    }
  }
private void trackWatchForAttempt(WatchedPathInfo watchedPathInfo, WatchKey watchKey) {
assert watchedPathInfo.pathIdentifier != null;
// TODO May be possible to do finer-grained locks.
synchronized (watchesPerAttempt) {
List<WatchKey> list = watchesPerAttempt.get(watchedPathInfo.pathIdentifier);
private void trackWatchForAttempt(WatchedPathInfo watchedPathInfo, WatchKey watchKey) {
assert watchedPathInfo.pathIdentifier != null;
// TODO May be possible to do finer-grained locks.
synchronized (watchesPerAttempt) {
List<WatchKey> list = watchesPerAttempt.get(watchedPathInfo.pathIdentifier);
if (list == null) {
list = new LinkedList<>();
watchesPerAttempt.put(watchedPathInfo.pathIdentifier, list);
}
list.add(watchKey);
}
}
private void trackWatchForAttempt(WatchedPathInfo watchedPathInfo, WatchKey watchKey) {
assert watchedPathInfo.pathIdentifier != null;
// TODO May be possible to do finer-grained locks.
synchronized (watchesPerAttempt) {
List<WatchKey> list = watchesPerAttempt.get(watchedPathInfo.pathIdentifier);
if (list == null) {
list = new LinkedList<>();
watchesPerAttempt.put(watchedPathInfo.pathIdentifier, list);
}
list.add(watchKey);
}
}