请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:CC1311P3主题中讨论的其他器件:test2.
工具/软件:
您好、
我创建了 3 个成功的线程、但只有一个执行他的代码、首先创建、为什么?
tirtos
此致
毫米
pthread_attr_init (&pAttrs);
detachState = pthread_create_detached;
RC = pthread_attr_setdetachstate (&pAttrs、detachState);
IF (RC!= 0)
{
while (1)
;
}
RC |= pthread_attr_setstacksize (&pAttrs、THREADSTACKSIZE);
IF (RC!= 0)
{
while (1)
;
}
priParam.sched_priority = 3;
pthread_attr_setschedparam (&pAttrs、&priParam);
rc = pthread_create (&thread2、&pAttrs、test2、NULL);
如果 (RC !=0){
while (1);
}
priParam.sched_priority = 2;
pthread_attr_setschedparam (&pAttrs、&priParam);
rc = pthread_create (&thread、&pAttrs、test、NULL);
如果 (RC !=0){
while (1);
}
priParam.sched_priority = 1;
pthread_attr_setschedparam (&pAttrs、&priParam);
rc = pthread_create (&thread1、&pAttrs、test1、NULL);
IF (RC!= 0)
{
while (1){}
}