Skip to content

Commit

Permalink
Fix a regression in CombinerExecutor implementation introduced with t…
Browse files Browse the repository at this point in the history
…he ability to return multiple post actions.
  • Loading branch information
vietj committed Aug 7, 2023
1 parent fa45c5e commit b887c5c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ public void submit(Action<S> action) {
}
final Task task = a.execute(state);
if (task != null) {
Task last = task.last();
if (head == null) {
assert tail == null;
tail = task;
for (Task next = tail.next();next != null;next = tail.next()) {
tail = tail.next();
}
tail = last;
head = task;
} else {
tail = tail.next(task);
tail.next(task);
tail = last;
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/io/vertx/core/net/impl/pool/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@ public Task replaceNext(Task next) {
return oldNext;
}

public Task last() {
Task current = this;
Task next;
while ((next = current.next) != null) {
current = next;
}
return current;
}

public Task next() {
return next;
}

public Task next(Task next) {
public void next(Task next) {
this.next = next;
return next;
}

protected final void runNextTasks() {
Expand Down

0 comments on commit b887c5c

Please sign in to comment.