I amtrying to spawn pthreads and send an integer as the argument but I am getting the following error when casting the argument to void. I tried to remove (void*) and make the conversion implicit but I still got the same error
error: invalid conversion from ‘int (*)(void*)’ to ‘void* (*)(void*)’ [-fpermissive]
rc=pthread_create(&threads[i],NULL,probSAT, (void *)&threads_args[i]);
void Solver::p(char** argc)
{
argvp=argc;
pthread_t threads[NTHREADS];
int threads_args[NTHREADS];
int i=0;
int rc;
for(i=0;i<5;i++)
if(order_heap.empty())
v[i]=i+1;
else
v[i]=(order_heap.removeMin())+1;
for (i=0;i<32;i++)
{
threads_args[i]=i;
rc=pthread_create(&threads[i],NULL,probSAT, (void *)&threads_args[i]);
}
pthread_exit(NULL);
return;
}