src/main/java/com/zy/core/MainProcess.java
@@ -22,6 +22,8 @@ private MainServiceImpl mainService; // 所属线程 private Thread thread; // 所属线程 private Thread agvThread; // 频率 private int i = 0; @@ -108,7 +110,7 @@ } public void agvStart(){ thread = new Thread(() -> { agvThread = new Thread(() -> { while (!Thread.currentThread().isInterrupted()) { try { @@ -134,12 +136,13 @@ } } }); thread.start(); agvThread.start(); } @PreDestroy public void shutDown(){ if (thread != null) thread.interrupt(); if (agvThread != null) agvThread.interrupt(); } }