Beremiz_service.py
branchwxPython4
changeset 3426 c2c366964913
parent 3307 eeec6e0ea269
parent 3420 da8cceaa247d
child 3443 a47d9debb0d9
--- a/Beremiz_service.py	Sun Feb 13 21:01:27 2022 +0100
+++ b/Beremiz_service.py	Sun Feb 13 21:05:19 2022 +0100
@@ -32,6 +32,7 @@
 import threading
 import shlex
 import traceback
+import threading
 from threading import Thread, Semaphore, Lock, currentThread
 from builtins import str as text
 from past.builtins import execfile
@@ -46,6 +47,14 @@
 from runtime.Stunnel import ensurePSK
 import util.paths as paths
 
+# In case system time is ajusted, it is better to use
+# monotonic timers for timers and other timeout based operations.
+# hot-patch threading module to force using monitonic time for all 
+# Thread/Timer/Event/Condition
+
+from runtime.monotonic_time import monotonic
+threading._time = monotonic
+
 try:
     from runtime.spawn_subprocess import Popen
 except ImportError: