Skip to content

Commit

Permalink
Synchronized access to future
Browse files Browse the repository at this point in the history
  • Loading branch information
bjester committed Jan 11, 2024
1 parent 9b8b285 commit bf6fe20
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ public static CompletableFuture<Boolean> reconcile(Context context, Executor exe
// Run through all the states and check them, then process the results
for (StateMap stateRef : StateMap.forReconciliation()) {
chain = chain.thenComposeAsync((_didReconcile) -> {
if (future.isCancelled()) {
return CompletableFuture.completedFuture(_didReconcile);
synchronized (future) {
if (future.isCancelled()) {
return CompletableFuture.completedFuture(_didReconcile);
}
}

Log.i(TAG, "Requesting sentinel check state " + stateRef);
Expand Down

0 comments on commit bf6fe20

Please sign in to comment.