Removed unnecessary locking.

This commit is contained in:
akwizgran
2012-11-24 11:46:49 +00:00
parent eb237e5bb0
commit 9a3157c3e6

View File

@@ -31,22 +31,13 @@ class PollingRemovableDriveMonitor implements RemovableDriveMonitor, Runnable {
}
public void start(Callback callback) throws IOException {
synchronized(this) {
assert !running;
assert this.callback == null;
running = true;
this.callback = callback;
}
this.callback = callback;
running = true;
pluginExecutor.execute(this);
}
public void stop() throws IOException {
synchronized(this) {
assert running;
assert callback != null;
running = false;
callback = null;
}
running = false;
synchronized(pollingLock) {
pollingLock.notifyAll();
}