Skip to content

Commit

Permalink
feat(eventLoop): optimize eventLoop
Browse files Browse the repository at this point in the history
  • Loading branch information
CLFutureX committed Aug 14, 2024
1 parent b1445e4 commit c8e5240
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ public void execute(Runnable task) {
}

public CompletableFuture<Void> shutdownGracefully() {
if (shutdown.compareAndSet(false, true)) {
if (!shutdownCf.isDone()) {
tasks.add(WAKEUP_TASK);
while (!shutdown.get()) {
if (shutdown.compareAndSet(false, true)) {
if (!shutdownCf.isDone()) {
tasks.add(WAKEUP_TASK);
}
}
}
return shutdownCf;
Expand Down

0 comments on commit c8e5240

Please sign in to comment.