utils/android: Fix race condition in LogcatMonitor

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.
1 file changed
tree: ab1d8daa7f3e21f91ddcf911d44b5476674f684f
  1. devlib/
  2. doc/
  3. src/
  4. .gitignore
  5. README.rst
  6. setup.py