mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
cleanup and last_update bugfix for comms thread
This commit is contained in:
parent
ccf06956f9
commit
71be6aca1a
@ -286,7 +286,7 @@ function thread__iss(smem)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
log._warning("iss thread exiting")
|
log._warning("iss thread exiting")
|
||||||
return
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
-- debug
|
-- debug
|
||||||
@ -305,6 +305,7 @@ function thread__iss(smem)
|
|||||||
return { exec = exec }
|
return { exec = exec }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- communications handler thread
|
||||||
function thread__comms(smem)
|
function thread__comms(smem)
|
||||||
-- execute thread
|
-- execute thread
|
||||||
local exec = function ()
|
local exec = function ()
|
||||||
@ -314,10 +315,10 @@ function thread__comms(smem)
|
|||||||
|
|
||||||
local comms_queue = smem.q.mq_comms
|
local comms_queue = smem.q.mq_comms
|
||||||
|
|
||||||
|
local last_update = util.time()
|
||||||
|
|
||||||
-- thread loop
|
-- thread loop
|
||||||
while true do
|
while true do
|
||||||
local last_update = util.time()
|
|
||||||
|
|
||||||
-- check for messages in the message queue
|
-- check for messages in the message queue
|
||||||
while comms_queue.ready() do
|
while comms_queue.ready() do
|
||||||
local msg = comms_queue.pop()
|
local msg = comms_queue.pop()
|
||||||
@ -344,7 +345,7 @@ function thread__comms(smem)
|
|||||||
-- check for termination request
|
-- check for termination request
|
||||||
if plc_state.shutdown then
|
if plc_state.shutdown then
|
||||||
log._warning("comms thread exiting")
|
log._warning("comms thread exiting")
|
||||||
return
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
-- delay before next check
|
-- delay before next check
|
||||||
|
Loading…
x
Reference in New Issue
Block a user