Loading core/java/android/os/HandlerThread.java +14 −2 Original line number Diff line number Diff line Loading @@ -79,15 +79,27 @@ public class HandlerThread extends Thread { return null; } boolean wasInterrupted = false; // If the thread has been started, wait until the looper has been created. synchronized (this) { while (isAlive() && mLooper == null) { try { wait(); } catch (InterruptedException e) { wasInterrupted = true; } } } /* * We may need to restore the thread's interrupted flag, because it may * have been cleared above since we eat InterruptedExceptions */ if (wasInterrupted) { Thread.currentThread().interrupt(); } return mLooper; } Loading Loading
core/java/android/os/HandlerThread.java +14 −2 Original line number Diff line number Diff line Loading @@ -79,15 +79,27 @@ public class HandlerThread extends Thread { return null; } boolean wasInterrupted = false; // If the thread has been started, wait until the looper has been created. synchronized (this) { while (isAlive() && mLooper == null) { try { wait(); } catch (InterruptedException e) { wasInterrupted = true; } } } /* * We may need to restore the thread's interrupted flag, because it may * have been cleared above since we eat InterruptedExceptions */ if (wasInterrupted) { Thread.currentThread().interrupt(); } return mLooper; } Loading