If you write the name of the function start_funwithout any parameters anywhere in your code, you will get a pointer to this function.
However, pthread_create expects a format function void* func (void*).
If rewriting a function is not a parameter, you will have to write a shell:
void* call_start_fun (void* dummy)
{
(void)dummy;
start_fun();
return 0;
}
then go to call_start_fun in pthread_create:
pthread_create(&thread, NULL, call_start_fun, NULL);
source
share