Skip to content

Commit 4b37578

Browse files
committed
[Bug] Add lock on RPC status watchdog
1 parent b3f47f2 commit 4b37578

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

spmt.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,13 @@
8989

9090
# Close Splashscreen
9191
splash.close()
92-
93-
##-- Launch RPC watchdog
94-
ex.mainWindow.rpc_watchdogThread.start()
95-
92+
93+
try:
94+
##-- Launch RPC watchdog
95+
ex.mainWindow.rpc_watchdogThread.start()
96+
except Exception as e:
97+
print(e)
98+
9699
# Execute App
97100
app.exec_()
98101
try:

src/watchdogThreads.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ def run(self):
3434
while not self.shutdown_flag.is_set():
3535
# update status without printing on debug
3636
self.control_tab.updateRPCstatus(self.ctrl_obj, False)
37+
with self.control_tab.lock:
38+
connected = self.control_tab.rpcConnected
3739

38-
if not self.control_tab.rpcConnected:
40+
if not connected:
3941
sleep(self.timer_off)
40-
4142
else:
4243
sleep(self.timer_on)
4344

0 commit comments

Comments
 (0)