Skip to content

Commit

Permalink
forget released grants, saved from previous run
Browse files Browse the repository at this point in the history
  • Loading branch information
eparovyshnaia committed Feb 21, 2022
1 parent 9b83038 commit adcaaeb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ void forget(GrantAcquisition grant) {
}
}

void forget(List<GrantAcquisition> bunch) {
synchronized (grants) {
grants.removeAll(bunch);
}
}

List<GrantAcquisition> grants() {
List<GrantAcquisition> all = new ArrayList<>();
synchronized (grants) {
Expand All @@ -57,4 +63,5 @@ private boolean notYetSpotted(GrantAcquisition grant) {
.map(GrantAcquisition::identifier)//
.noneMatch(grant.identifier()::equals);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public synchronized void trace(GrantAcquisition grant) {
synchronized (storage) {
if (fresh) {
fresh = false;
conduit.release(storage.grants());
storage.forget(conduit.release(storage.grants()));
}
storage.keep(grant);
residence.write(storage.grants());
Expand Down

0 comments on commit adcaaeb

Please sign in to comment.