Comments to indicate which locks guard which variables.

This commit is contained in:
akwizgran
2015-01-29 11:05:46 +00:00
parent 47bd84122e
commit 0dbfd7073f
21 changed files with 235 additions and 1092 deletions

View File

@@ -13,20 +13,22 @@ import net.contentobjects.jnotify.JNotifyListener;
abstract class UnixRemovableDriveMonitor implements RemovableDriveMonitor,
JNotifyListener {
//TODO: rationalise this in a further refactor
private static final Lock staticSynchLock = new ReentrantLock();
// The following are locking: staticSynchLock
private static boolean triedLoad = false;
private static Throwable loadError = null;
private final List<Integer> watches = new ArrayList<Integer>();
private final Lock synchLock = new ReentrantLock();
// The following are locking: synchLock
private final List<Integer> watches = new ArrayList<Integer>();
private boolean started = false;
private Callback callback = null;
protected abstract String[] getPathsToWatch();
//TODO: rationalise this in a further refactor
private final Lock synchLock = new ReentrantLock();
private static final Lock staticSynchLock = new ReentrantLock();
private static Throwable tryLoad() {
try {
Class.forName("net.contentobjects.jnotify.JNotify");