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.

RTOS/CC2640R2F: How to create pthread in TIRTOS

Part Number: CC2640R2F

Tool/software: TI-RTOS

Now  i am crate two pthread 

1. pthread 

pthread_attr_init(&attrs);
#if 1
/* Set priority, detach state, and stack size attributes */
priParam.sched_priority = 1;
retc = pthread_attr_setschedparam(&attrs, &priParam);
retc |= pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED);
retc |= pthread_attr_setstacksize(&attrs, THREADSTACKSIZE);
if (retc != 0) {
/* failed to set attributes */
while (1) {}
}
retc = pthread_create(&thread, &attrs, mainThread, NULL);
if (retc != 0) {
/* pthread_create() failed */
while (1) {}
}
#endif
/*
* Let's make the temperature thread a higher priority .
* Higher number means higher priority in TI-RTOS.
*/

2. pthread 
priParam.sched_priority = 2;
retc = pthread_attr_setschedparam(&attrs, &priParam);
if (retc != 0) {
/* failed to set priority */
while (1) {}
}
retc = pthread_create(&thread, &attrs, tft_mainThread, NULL);
if (retc != 0) {
/* pthread_create() failed */
while (1) {}
}
/* Create a mutex that will protect temperature variables */
retc = pthread_mutex_init(&tft_mainThread, NULL);
if (retc != 0) {
/* pthread_mutex_init() failed */
while (1) {}
}

BIOS_start();

But First time run in debugger mode . Not a running the code . 

next time reset run running  the pthread.

* Above the procedure is correct or wrong.