Skip to content

Commit

Permalink
vavr-io#2552 Condition to not execute actions if future is cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
charvakcpatel007 committed Jul 27, 2020
1 parent 0b7a72c commit 8cd98c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/io/vavr/concurrent/FutureImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ boolean tryComplete(Try<? extends T> value) {
if (waiters != null) {
waiters.forEach(this::unlock);
}
if(isCancelled()) {
return true;
}
if (actions != null) {
actions.forEach(this::perform);
return true;
Expand Down

0 comments on commit 8cd98c3

Please sign in to comment.