mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 21:29:54 +01:00
Address review feedback.
This commit is contained in:
@@ -36,7 +36,7 @@ interface TorReachabilityMonitor {
|
||||
* Observers are removed after being called, or when the monitor is
|
||||
* {@link #destroy() destroyed}.
|
||||
*/
|
||||
void addObserver(TorReachabilityObserver o);
|
||||
void addOneShotObserver(TorReachabilityObserver o);
|
||||
|
||||
interface TorReachabilityObserver {
|
||||
|
||||
|
||||
@@ -70,13 +70,14 @@ class TorReachabilityMonitorImpl
|
||||
eventBus.removeListener(this);
|
||||
synchronized (lock) {
|
||||
destroyed = true;
|
||||
onTorInactive();
|
||||
if (task != null) task.cancel();
|
||||
task = null;
|
||||
observers.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addObserver(TorReachabilityObserver o) {
|
||||
public void addOneShotObserver(TorReachabilityObserver o) {
|
||||
boolean callNow = false;
|
||||
synchronized (lock) {
|
||||
if (destroyed) return;
|
||||
|
||||
Reference in New Issue
Block a user