update readme

This commit is contained in:
hyb1996
2017-08-16 11:10:21 +08:00
parent 7b1a5fc675
commit 8dd93e55cf
8 changed files with 48 additions and 18 deletions

View File

@@ -18,17 +18,14 @@ public class Loopers {
public volatile boolean waitWhenIdle = false;
private volatile Looper mServantLooper;
private static volatile ConcurrentHashMap<Thread, Looper> sLoopers = new ConcurrentHashMap<>();
private static Field MESSAGE_QUEUE_MESSAGE;
private Timers mTimers;
private MessageQueue mMessageQueue;
public Loopers(Timers timers) {
mTimers = timers;
if (Looper.myLooper() == Looper.getMainLooper()) {
waitWhenIdle = true;
}
mMessageQueue = Looper.myQueue();
mMessageQueue.addIdleHandler(new MessageQueue.IdleHandler() {
Looper.myQueue().addIdleHandler(new MessageQueue.IdleHandler() {
@Override
public boolean queueIdle() {
Looper l = Looper.myLooper();

View File

@@ -108,6 +108,7 @@ public class Timers {
public boolean hasPendingCallback() {
return mFutureCallbackUptimeMillis > SystemClock.uptimeMillis();
}
}