您的位置:首页 > 其它

线程的优先级

2015-09-07 15:03 399 查看
NSThread *t1 = [[NSThread alloc] initWithTarget:self selector:@selector(createThreadOne) object:nil];
t1.name = @"线程A";
//修改优先级
t1.threadPriority = 0;
[t1 start];

NSThread *t2 = [[NSThread alloc] initWithTarget:self selector:@selector(createThreadTwo) object:nil];
t2.name = @"线程B";
t2.threadPriority = 1;
[t2 start];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: