Other Parts Discussed in Thread: CC2640R2F
我看到有些demo重使用了task,有些demo重使用了thread,请问这两种有什么区别呢? 还是说底层都是一样的东西
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我使用ccs导入一个cc2640r2f sdk里的empty项目后看到如下代码
int main(void)
{
pthread_t thread;
pthread_attr_t attrs;
struct sched_param priParam;
int retc;
int detachState;
/* Call driver init functions */
Board_initGeneral();
/* Set priority and stack size attributes */
pthread_attr_init(&attrs);
priParam.sched_priority = 1;
detachState = PTHREAD_CREATE_DETACHED;
retc = pthread_attr_setdetachstate(&attrs, detachState);
if (retc != 0) {
/* pthread_attr_setdetachstate() failed */
while (1);
}
pthread_attr_setschedparam(&attrs, &priParam);
retc |= pthread_attr_setstacksize(&attrs, THREADSTACKSIZE);
if (retc != 0) {
/* pthread_attr_setstacksize() failed */
while (1);
}
retc = pthread_create(&thread, &attrs, mainThread, NULL);
if (retc != 0) {
/* pthread_create() failed */
while (1);
}
BIOS_start();
return (0);
}
没有看到这个线程是什么类型的设置呢?