I'm trying to understand how pthread_create
and pthread_join
works. I thought that the third argument of pthread_create
only allows functions with one argument of void*. I compiled the code below with gcc and it worked just fine. But why?
void *foo() {
return 0;
}
int main() {
pthread_t thread_id;
int par = 5;
pthread_create(&thread_id, NULL, foo, &par);
pthread_join(thread_id, NULL);
return 0;
}