I am attempting to make the following call,
PID = pthread_create(&t, NULL, schedule_sync(sch,t1), NULL);
schedule_sync returns a value, I would like to be able to grab that value, but from what Ive read about pthread_create, you should pass a “void” function. Is it possible to get the return value of schedule_sync, or am I going to have to modify some kind of parameter passed in?
Thanks for the help!
pthread_createreturns an<errno.h>code. It doesn’t create a new process so there’s no new PID.To pass a pointer to your function, take its address with
&.pthread_createtakes a function of formvoid *func( void * ).So assuming
schedule_syncis the thread function,