线程的优先级

 1     NSThread *t1 = [[NSThread alloc] initWithTarget:self selector:@selector(createThreadOne) object:nil];
 2     t1.name = @"线程A";
 3     //修改优先级
 4     t1.threadPriority = 0;
 5     [t1 start];
 6     
 7     NSThread *t2 = [[NSThread alloc] initWithTarget:self selector:@selector(createThreadTwo) object:nil];
 8     t2.name = @"线程B";
 9     t2.threadPriority = 1;
10     [t2 start];

 

posted on 2015-09-07 15:03  Baymax01  阅读(143)  评论(0编辑  收藏  举报

导航