equal
deleted
inserted
replaced
30 import sys |
30 import sys |
31 import getopt |
31 import getopt |
32 import threading |
32 import threading |
33 import shlex |
33 import shlex |
34 import traceback |
34 import traceback |
|
35 import threading |
35 from threading import Thread, Semaphore, Lock, currentThread |
36 from threading import Thread, Semaphore, Lock, currentThread |
36 from builtins import str as text |
37 from builtins import str as text |
37 from past.builtins import execfile |
38 from past.builtins import execfile |
38 from six.moves import builtins |
39 from six.moves import builtins |
39 |
40 |
43 from runtime import LogMessageAndException |
44 from runtime import LogMessageAndException |
44 from runtime import PlcStatus |
45 from runtime import PlcStatus |
45 from runtime import default_evaluator |
46 from runtime import default_evaluator |
46 from runtime.Stunnel import ensurePSK |
47 from runtime.Stunnel import ensurePSK |
47 import util.paths as paths |
48 import util.paths as paths |
|
49 |
|
50 # In case system time is ajusted, it is better to use |
|
51 # monotonic timers for timers and other timeout based operations. |
|
52 # hot-patch threading module to force using monitonic time for all |
|
53 # Thread/Timer/Event/Condition |
|
54 |
|
55 from runtime.monotonic_time import monotonic |
|
56 threading._time = monotonic |
48 |
57 |
49 try: |
58 try: |
50 from runtime.spawn_subprocess import Popen |
59 from runtime.spawn_subprocess import Popen |
51 except ImportError: |
60 except ImportError: |
52 from subprocess import Popen |
61 from subprocess import Popen |