Synchronize around the wait call that keeps the service running.

This commit is contained in:
Mark Milligan 2022-11-17 17:21:36 -06:00
parent bf648f069c
commit 95a554422d
2 changed files with 7 additions and 5 deletions

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>lantern-currentmonitor</artifactId>
<packaging>jar</packaging>
<version>1.1.2</version>
<version>1.1.3</version>
<name>lantern-currentmonitor</name>
<parent>

View File

@ -301,10 +301,12 @@ public class MonitorApp {
monitor.stop();
pool.shutdown();
}, "Monitor Shutdown"));
try {
monitor.wait();
} catch (InterruptedException _e) {
LOG.error("Interrupted, shutting down", _e);
synchronized (monitor) {
try {
monitor.wait();
} catch (InterruptedException _e) {
LOG.error("Interrupted, shutting down", _e);
}
}
}