From 37a84590794954175fdcfa8a5c5b1febc08b21f2 Mon Sep 17 00:00:00 2001 From: whyclj <1525436766@qq.com> Date: 星期四, 31 十二月 2020 09:04:42 +0800 Subject: [PATCH] 修复停止监听后线程仍未停止bug --- src/com/sp_comm/Central_Monitor_Thread.java | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/com/sp_comm/Central_Monitor_Thread.java b/src/com/sp_comm/Central_Monitor_Thread.java index 5efa557..be6ff1d 100644 --- a/src/com/sp_comm/Central_Monitor_Thread.java +++ b/src/com/sp_comm/Central_Monitor_Thread.java @@ -19,6 +19,7 @@ public boolean auto_update_data = false; //自动随机数据 public boolean write_data = false; //写入数据 + public boolean running_en = true; //是否运行 public Central_ST_Data data; @@ -38,7 +39,8 @@ } catch (InterruptedException e1) { e1.printStackTrace(); } - while(true) { + while(running_en) { + //System.out.println(this.getClass().getName()); try { /********* 读取数据 ****************************************************/ if(read_data) { -- Gitblit v1.9.1