18.Handler消息机制时序图
2023-02-24 13:32:46 92 举报
Handler消息机制时序图
作者其他创作
大纲/内容
msg
此处取消息,需要一直循环获取,如果还没到达时间,就休眠,还有一个同步屏障的概念需要注意
Looper.loop()
sendMessage(msg)
mLooper、mQueue
sThreadLocal.set(Looper)
queue.next()
handleMessage()
msg.target.dispatchMessage(msg)
MessageQueue()
Looper.myLooper()
sendMessageAtTime
MessageQueue
new Looper()
mQueue
ActivityThread
Looper.prepareMainLooper();
mThread = Thread.currentThread()
ThreadLocal
main()
sThreadLocal.get()
Handler
Looper
XxxActivity
new Handler()
mHandler
0 条评论
下一页