Skip to content

Commit

Permalink
add a thread join to wait for consumer thread termination
Browse files Browse the repository at this point in the history
  • Loading branch information
purbon committed Oct 20, 2021
1 parent 0f304c9 commit 641f3b8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void run() {
try {
consumer.retrieve(callback);
} catch (WakeupException ex) {
LOGGER.error(ex);
LOGGER.trace(ex);
}
}
}
Expand Down Expand Up @@ -97,6 +97,11 @@ public BackendState load() throws IOException {
public void close() {
consumer.stop();
producer.stop();
try {
thread.join();
} catch (InterruptedException e) {
LOGGER.error(e);
}
latest = null;
thread = null;
}
Expand Down

0 comments on commit 641f3b8

Please sign in to comment.