1.Runloop对象的获取方式

2.Runloop与线程的关系

3.Runloop获取的底层实现
3.1 CFRunloopGetCurrent(void)函数

3.2 _CFRunloopGet0(pthread_t t)函数
调用分析:
1.以线程t为键,从全局字典_CFRunloops中查找所属线程的runloop。
2.如果runloop不存在,将所传入的线程作为key创建一个runloop,并将其保存到_CFRunloops中。

调用分析:
1.以线程t为键,从全局字典_CFRunloops中查找所属线程的runloop。
2.如果runloop不存在,将所传入的线程作为key创建一个runloop,并将其保存到_CFRunloops中。
本文标题:三十三、Runloop之(二) Runloop对象的获取方式
本文链接:https://www.haomeiwen.com/subject/iaxfaqtx.html
网友评论