mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 13:49:53 +01:00
Hold lock while calling notifyObservers().
This commit is contained in:
@@ -94,15 +94,15 @@ abstract class RemovableDriveTaskImpl implements RemovableDriveTask {
|
|||||||
done = min(state.getDone() + done, state.getTotal());
|
done = min(state.getDone() + done, state.getTotal());
|
||||||
state = new State(done, state.getTotal(), state.isFinished(),
|
state = new State(done, state.getTotal(), state.isFinished(),
|
||||||
state.isSuccess());
|
state.isSuccess());
|
||||||
|
notifyObservers();
|
||||||
}
|
}
|
||||||
notifyObservers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setSuccess(boolean success) {
|
void setSuccess(boolean success) {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
state = new State(state.getDone(), state.getTotal(), true, success);
|
state = new State(state.getDone(), state.getTotal(), true, success);
|
||||||
|
notifyObservers();
|
||||||
}
|
}
|
||||||
notifyObservers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GuardedBy("lock")
|
@GuardedBy("lock")
|
||||||
|
|||||||
Reference in New Issue
Block a user