getvariana: tpp.c:63: __pthread_tpp_change_priority: Assertion `new_prio == -1 || (new_prio >= __sched_fifo_min_prio && new_prio <= __sched_fifo_max_prio)' failed.
Hi all,
I am trying to re-run a program which creates 5 threads and after pthread_join(), I do a return, based on which, I re-run the entire program i.e., it is in while(1) loop.
When I run the program for the second time, I get an error as you can see above. I am unable to trace its origin. Can anyone please explain why is this error caused ?
FYI: I dont use any mutex locks or semaphore. I wait for the threads to join after which I re-run the entire program. Does it have anything to do with race conditions ? I am assuming, that when I wait for all the 5 threads to join, only then I can move out of the pthread
main
{
while(1)
{
test();
}
}//main
test()
{
for( i = 0; i < 5; i++ )
pthread_create( &th[i], NULL, tfunc, &some_struct);
for( i = 0; i < 5, i++ )
pthread_join( th[i], NULL);
}
void * tfunc( void * ptr )
{
// waiting for a callback function to set a global counter to a value
// sleep until then
if( g_count == value_needed )
pthread_exit(NULL);
}