Skip to content

Commit

Permalink
Use synchronized latch to keep senderOnComplete called once
Browse files Browse the repository at this point in the history
  • Loading branch information
Pil0tXia committed Apr 13, 2024
1 parent 878009a commit 8e812cd
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,15 @@ public void run() {
}

public void close() {
if (this.sender != null) {
senderOnComplete();
synchronized (sender) {
if (latch.getCount() == 0) {
return;
}
if (this.sender != null) {
senderOnComplete();
}
latch.countDown();
}

latch.countDown();

log.info("SubStreamHandler closed.");
}

Expand Down

0 comments on commit 8e812cd

Please sign in to comment.