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 { public void start(Callback callback) throws IOException {
synchronized(this) { this.callback = callback;
assert !running; running = true;
assert this.callback == null;
running = true;
this.callback = callback;
}
pluginExecutor.execute(this); pluginExecutor.execute(this);
} }
public void stop() throws IOException { public void stop() throws IOException {
synchronized(this) { running = false;
assert running;
assert callback != null;
running = false;
callback = null;
}
synchronized(pollingLock) { synchronized(pollingLock) {
pollingLock.notifyAll(); pollingLock.notifyAll();
} }