From dfbd8f002de1ee4d1807c6d6c8d3de2276df3f12 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <xltys1995> Date: 星期四, 24 九月 2020 13:16:10 +0800 Subject: [PATCH] #线程安全问题 --- src/main/java/com/zy/core/thread/DevpThread.java | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/zy/core/thread/DevpThread.java b/src/main/java/com/zy/core/thread/DevpThread.java index 84e83ec..90d5837 100644 --- a/src/main/java/com/zy/core/thread/DevpThread.java +++ b/src/main/java/com/zy/core/thread/DevpThread.java @@ -192,6 +192,7 @@ // status[4] = staProtocol.isEmptyMk(); // OperateResult write2 = siemensS7Net.Write("DB100." + ((staProtocol.getSiteId() - 1) + 40), status); // 鐘舵�� if (!write.IsSuccess || !write1.IsSuccess) { + staProtocol = station.get(staProtocol.getSiteId()); if (staProtocol.getWorkNo() == 0 && staProtocol.getStaNo() ==0) { staProtocol.setPakMk(true); } @@ -250,6 +251,16 @@ } } + /** + * 璁剧疆鍏ュ簱鏍囪 + */ + public void setPakMk(Integer siteId, boolean pakMk) { + StaProtocol staProtocol = station.get(siteId); + if (null != staProtocol) { + staProtocol.setPakMk(pakMk); + } + } + @Override public void close() { siemensS7Net.ConnectClose(); -- Gitblit v1.9.1