Hi,
I'm kinda new to posix theads.
i've been using the out of the box project to make a new thread from the mainthread() method.
the function i want to launch is a loop that check uart incoming messages.
But it seems that the way i'm doing it is causing the system to freeze (dead lock) ?
is is possible to put a while(1) in the function i'm launching on another thread ?
here's the code starting the thread :
int32_t RetVal; pthread_attr_t pAttrs; struct sched_param priParam; pthread_attr_init(&pAttrs); priParam.sched_priority = 1; RetVal = pthread_attr_setschedparam(&pAttrs, &priParam); RetVal |= pthread_attr_setstacksize(&pAttrs, LINKLOCAL_STACK_SIZE); if (RetVal) { /* Handle Error */ UART_PRINT("Unable to configure thread parameters \n"); while (1) { ; } } RetVal = pthread_create(&thread, &pAttrs, test, NULL);
and my loop in test (without uart, just testing the thead)
void* test(void *pvParameters) { int a=0; while (1) { a=0; for (int i = 0; i < 10000000; i++) { a++; } UART_PRINT("test of doom\r\n"); } }
I tried to change the thread priority... but nothing seems to work..