I have to call one method in seperate thread (i am using posix thread)which updates some value after every 5 second for which have written below code.
void *threadEntry(void *)
{
while(1)
{
updateValue();//to update some values
usleep(5000000);//pause for 5 second
}
}
pthread_t thread1;
pthread_create(&thread1,NULL,threadEntry,NULL);
But this thread gets segmentation fault after 4-5 minutes .What can be reason?Is there any other way to pause the posix thread.(i am using linux)