mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 21:59:54 +01:00
Revert lock variable rename for clarity
This commit is contained in:
@@ -22,8 +22,8 @@ class PollingRemovableDriveMonitor implements RemovableDriveMonitor, Runnable {
|
|||||||
private volatile boolean running = false;
|
private volatile boolean running = false;
|
||||||
private volatile Callback callback = null;
|
private volatile Callback callback = null;
|
||||||
|
|
||||||
private final Lock synchLock = new ReentrantLock();
|
private final Lock pollingLock = new ReentrantLock();
|
||||||
private final Condition stopPolling = synchLock.newCondition();
|
private final Condition stopPolling = pollingLock.newCondition();
|
||||||
|
|
||||||
|
|
||||||
public PollingRemovableDriveMonitor(Executor ioExecutor,
|
public PollingRemovableDriveMonitor(Executor ioExecutor,
|
||||||
@@ -41,12 +41,12 @@ class PollingRemovableDriveMonitor implements RemovableDriveMonitor, Runnable {
|
|||||||
|
|
||||||
public void stop() throws IOException {
|
public void stop() throws IOException {
|
||||||
running = false;
|
running = false;
|
||||||
synchLock.lock();
|
pollingLock.lock();
|
||||||
try {
|
try {
|
||||||
stopPolling.signalAll();
|
stopPolling.signalAll();
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
synchLock.unlock();
|
pollingLock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,12 +54,12 @@ class PollingRemovableDriveMonitor implements RemovableDriveMonitor, Runnable {
|
|||||||
try {
|
try {
|
||||||
Collection<File> drives = finder.findRemovableDrives();
|
Collection<File> drives = finder.findRemovableDrives();
|
||||||
while(running) {
|
while(running) {
|
||||||
synchLock.lock();
|
pollingLock.lock();
|
||||||
try {
|
try {
|
||||||
stopPolling.await(pollingInterval, TimeUnit.MILLISECONDS);
|
stopPolling.await(pollingInterval, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
finally{
|
finally{
|
||||||
synchLock.unlock();
|
pollingLock.unlock();
|
||||||
}
|
}
|
||||||
if(!running) return;
|
if(!running) return;
|
||||||
Collection<File> newDrives = finder.findRemovableDrives();
|
Collection<File> newDrives = finder.findRemovableDrives();
|
||||||
|
|||||||
Reference in New Issue
Block a user