Skip to content

Commit

Permalink
build: update FlowSched
Browse files Browse the repository at this point in the history
  • Loading branch information
ishland committed Dec 11, 2023
1 parent a641cb3 commit a9b1df2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ public ScheduledTask(long pos, Supplier<CompletableFuture<T>> action, LockToken[
}

@Override
public void run() {
public void run(Runnable releaseLocks) {
action.get().whenComplete((t, throwable) -> {
releaseLocks.run();
if (throwable != null) {
future.completeExceptionally(throwable);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ public WrappingTask(long pos, Runnable wrapped) {
}

@Override
public void run() {
public void run(Runnable releaseLocks) {
try {
wrapped.run();
} finally {
releaseLocks.run();
for (Runnable runnable : this.postExec) {
try {
runnable.run();
Expand Down

0 comments on commit a9b1df2

Please sign in to comment.