mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
check shutdown flag in worker loops so they don't lock up the exit process
This commit is contained in:
parent
82726520b8
commit
46a27a3f3a
@ -12,7 +12,7 @@ os.loadAPI("config.lua")
|
|||||||
os.loadAPI("plc.lua")
|
os.loadAPI("plc.lua")
|
||||||
os.loadAPI("threads.lua")
|
os.loadAPI("threads.lua")
|
||||||
|
|
||||||
local R_PLC_VERSION = "alpha-v0.4.3"
|
local R_PLC_VERSION = "alpha-v0.4.4"
|
||||||
|
|
||||||
local print = util.print
|
local print = util.print
|
||||||
local println = util.println
|
local println = util.println
|
||||||
|
@ -239,7 +239,7 @@ function thread__iss(smem)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- check for messages in the message queue
|
-- check for messages in the message queue
|
||||||
while iss_queue.ready() do
|
while iss_queue.ready() and not plc_state.shutdown do
|
||||||
local msg = iss_queue.pop()
|
local msg = iss_queue.pop()
|
||||||
|
|
||||||
if msg.qtype == mqueue.TYPE.COMMAND then
|
if msg.qtype == mqueue.TYPE.COMMAND then
|
||||||
@ -331,7 +331,7 @@ function thread__comms(smem)
|
|||||||
-- thread loop
|
-- thread loop
|
||||||
while true do
|
while true do
|
||||||
-- check for messages in the message queue
|
-- check for messages in the message queue
|
||||||
while comms_queue.ready() do
|
while comms_queue.ready() and not plc_state.shutdown do
|
||||||
local msg = comms_queue.pop()
|
local msg = comms_queue.pop()
|
||||||
|
|
||||||
if msg.qtype == mqueue.TYPE.COMMAND then
|
if msg.qtype == mqueue.TYPE.COMMAND then
|
||||||
|
@ -19,7 +19,7 @@ os.loadAPI("dev/boiler_rtu.lua")
|
|||||||
os.loadAPI("dev/imatrix_rtu.lua")
|
os.loadAPI("dev/imatrix_rtu.lua")
|
||||||
os.loadAPI("dev/turbine_rtu.lua")
|
os.loadAPI("dev/turbine_rtu.lua")
|
||||||
|
|
||||||
local RTU_VERSION = "alpha-v0.4.3"
|
local RTU_VERSION = "alpha-v0.4.4"
|
||||||
|
|
||||||
local print = util.print
|
local print = util.print
|
||||||
local println = util.println
|
local println = util.println
|
||||||
|
@ -121,7 +121,7 @@ function thread__comms(smem)
|
|||||||
-- thread loop
|
-- thread loop
|
||||||
while true do
|
while true do
|
||||||
-- check for messages in the message queue
|
-- check for messages in the message queue
|
||||||
while comms_queue.ready() do
|
while comms_queue.ready() and not plc_state.shutdown do
|
||||||
local msg = comms_queue.pop()
|
local msg = comms_queue.pop()
|
||||||
|
|
||||||
if msg.qtype == mqueue.TYPE.COMMAND then
|
if msg.qtype == mqueue.TYPE.COMMAND then
|
||||||
|
Loading…
Reference in New Issue
Block a user