I have seen the documentation of pthread_create
In the example at the bottom they are using:
pthread_create(&tinfo[tnum].thread_id, &attr, &t
Short answer: both are correct.
The signature of pthread_create
is:
int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg);
So start_routine
is a function pointer that takes a void *
argument and returns void *
.
Back to your question, I assume thread_start
is the name of the function, so &thread_start
is a function pointer which is correct.
However, thread_start
is correct, too, because the function name is automatically converted to a function pointer.