0.线程状态
新建 --> 就绪(在可调度线程池中,等待被CPU的调度执行) --> 运行
运行 --> CPU切换到其他的线程 --> 就绪
运行 --> 调用的sleep方法 --> 阻塞 --> sleep的时间到了 --> 就绪
运行 --> 任务执行完成 --> 死亡
运行 --> exit --> 死亡
1.新建
内存中创建了一个线程对象
NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(threadDemo) object:nil];
2.就绪
将线程放进可调度线程池,等待被CPU调度
[thread start];
3.运行
CPU负责调度”可调度线程池”中的处于”就绪状态”的线程
线程执行结束之前,