Hold lock while calling notifyObservers().

This commit is contained in:
akwizgran
2021-06-15 11:47:10 +01:00
committed by Torsten Grote
parent 5e98bd0b53
commit 23acd186f7

View File

@@ -94,15 +94,15 @@ abstract class RemovableDriveTaskImpl implements RemovableDriveTask {
done = min(state.getDone() + done, state.getTotal());
state = new State(done, state.getTotal(), state.isFinished(),
state.isSuccess());
notifyObservers();
}
notifyObservers();
}
void setSuccess(boolean success) {
synchronized (lock) {
state = new State(state.getDone(), state.getTotal(), true, success);
notifyObservers();
}
notifyObservers();
}
@GuardedBy("lock")