# HG changeset patch # User Edouard Tisserant # Date 1555503502 -7200 # Node ID 0e20a0d48fae80618818b140de568a4d80ee6db1 # Parent b4649f014a39f6613ca96c53a280d9842fe22a8c Named runtime's threads to ease debugging diff -r b4649f014a39 -r 0e20a0d48fae Beremiz_service.py --- a/Beremiz_service.py Wed Apr 17 14:15:39 2019 +0200 +++ b/Beremiz_service.py Wed Apr 17 14:18:22 2019 +0200 @@ -532,7 +532,8 @@ pyro_thread_started = Lock() pyro_thread_started.acquire() pyro_thread = Thread(target=pyroserver.PyroLoop, - kwargs=dict(when_ready=pyro_thread_started.release)) + kwargs=dict(when_ready=pyro_thread_started.release), + name="PyroThread") pyro_thread.start() # Wait for pyro thread to be effective @@ -557,7 +558,7 @@ else: ui_thread_target = app.MainLoop - ui_thread = Thread(target=ui_thread_target) + ui_thread = Thread(target=ui_thread_target, name="UIThread") ui_thread.start() # This order ui loop to unblock main thread when ready. diff -r b4649f014a39 -r 0e20a0d48fae runtime/PLCObject.py --- a/runtime/PLCObject.py Wed Apr 17 14:15:39 2019 +0200 +++ b/runtime/PLCObject.py Wed Apr 17 14:18:22 2019 +0200 @@ -388,7 +388,7 @@ self.PythonThreadCondLock = Lock() self.PythonThreadCond = Condition(self.PythonThreadCondLock) self.PythonThreadCmd = "Wait" - self.PythonThread = Thread(target=self.PythonThreadProc) + self.PythonThread = Thread(target=self.PythonThreadProc, name="PLCPythonThread") self.PythonThread.start() # used internaly @@ -645,7 +645,7 @@ def _TracesSwap(self): self.LastSwapTrace = time() if self.TraceThread is None and self.PLCStatus == PlcStatus.Started: - self.TraceThread = Thread(target=self.TraceThreadProc) + self.TraceThread = Thread(target=self.TraceThreadProc, name="PLCTrace") self.TraceThread.start() self.TraceLock.acquire() Traces = self.Traces