2
I’m using pthread.h
and using the following functions:
//
// Cria A thread
//
thread_argsPP[contthreadsPP] = contthreadsPP;
pthread_create(&threadsPP[contthreadsPP], NULL, ReceivePinPad, (void *) &thread_argsPP[contthreadsPP]);
//
// Inicia a thread
//
pthread_join(threadsPP[contthreadsPP], NULL);
//
// Fecha a thread Recive
//
pthread_detach(pthread_self());
pthread_exit(NULL);
But after closing the thread I can’t recreate it, I wonder if there’s any way to reuse a pthread after the pthread_exit(NULL)
.
Of what types are the variables
thread_argsPP
,contthreadsPP
andthreadsPP
? Please paste their statement as this is essential to understand your problem. It seems to me you are losing the reference to some of the objects/ structures when you could not.– Fernando Silveira