mirror of
https://github.com/ARM-software/devlib.git
synced 2025-09-24 04:41:54 +01:00
If you call .start then immediately call .stop, the thread may not yet have set ._logcat, resulting in an AttributeError. I initially fixed this by setting _logcat = None in __init__, then putting the `kill` calls inside `if self._logcat`. The problem with this, as pointed out by @valschneider, is that we can then have this sequence: main thread: monitor thread stop() run() if self._logcat: . # False, don't kill process . join() . self._logcat = <...> Therefore, just have the stop() method wait until the process is started before unconditionally killing it.