139/**
140 * Returns whether this looper's thread is currently polling for more work to do.
141 * This is a good signal that the loop is still alive rather than being stuck
142 * handling a callback. Note that this method is intrinsically racy, since the
143 * state of the loop can change before you get the result back.
144 *
145 * <p>This method is safe to call from any thread.
146 *
147 * @return True if the looper is currently polling for events.
148 * @hide
149 */150publicbooleanisPolling(){
151synchronized (this) {
152return isPollingLocked();
153 }
154 }
155复制代码

2381 Watchdog.getInstance().addMonitor(this);
19655/** In this method we try to acquire our lock to make sure that we have not deadlocked */19656publicvoidmonitor(){
19657synchronized (this) { }
19658 }
复制代码