getvariana: tpp.c: 63: __pthread_tpp_change_priority: Statement `new_prio == -1 || (new_prio> = __sched_fifo_min_prio & new_prio <= __sched_fifo_max_prio) 'failed.
Hello everybody,
I'm trying to restart a program that creates 5 threads and after pthread_join (), I make a return based on which I re-run the whole program, that is, it is in the while (1) loop.
When I run the program a second time, I get an error message, as you can see above. I can not trace its origin. Can someone explain the reason for this error?
FYI: I do not use any locks or mutex semaphores. I wait for the threads to join, after which I started the whole program again. Does this have anything to do with race conditions? I assume that when I wait for all 5 threads to join, only then can I exit pthread
main
{
while(1)
{
test();
}
}
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 )
{
if( g_count == value_needed )
pthread_exit(NULL);
}
source
share