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> <modelVersion>4.0.0</modelVersion>
<artifactId>lantern-currentmonitor</artifactId> <artifactId>lantern-currentmonitor</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.1.2</version> <version>1.1.3</version>
<name>lantern-currentmonitor</name> <name>lantern-currentmonitor</name>
<parent> <parent>

View File

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