mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
utils/android: Don't lock up if LogcatMonitor stopped before start
Calling stop before start will result in hanging in self._started.wait(), because that event will never get set. Although stop before start is an illegal usage pattern, let's try not to fail annoyingly.
This commit is contained in:
parent
8cf4a44bd7
commit
22c1f5e911
@ -589,6 +589,10 @@ class LogcatMonitor(threading.Thread):
|
||||
self._add_line(line)
|
||||
|
||||
def stop(self):
|
||||
if not self.is_alive():
|
||||
logger.warning('LogcatMonitor.stop called before start')
|
||||
return
|
||||
|
||||
# Make sure we've started before we try to kill anything
|
||||
self._started.wait()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user