Update HandlerThread.md

master
Omooo 5 years ago
parent eb62b075b7
commit c83269b9d2
  1. 2
      blogs/Android/HandlerThread.md

@ -103,6 +103,7 @@ public class HandlerThread extends Thread {
Looper.prepare();
synchronized (this) {
mLooper = Looper.myLooper();
// 通知取 Looper 的线程,此时 Looper 已经创建好了
notifyAll();
}
Process.setThreadPriority(mPriority);
@ -119,6 +120,7 @@ public class HandlerThread extends Thread {
synchronized (this) {
while (isAlive() && mLooper == null) {
try {
// 如果新线程还未创建 Looper,则等待
wait();
} catch (InterruptedException e) {
}

Loading…
Cancel
Save