As the title says, I'm curious as to why thread functions accept only one void *
argument instead of how a normal function accepts whatever arguments you want to pass in:
#include <pthread.h>
int pthread_create(pthread_t *restrict thread,
const pthread_attr_t *restrict attr,
void *(*start_routine)(void *),
void *restrict arg);
I'm talking about that last arg
in pthread_create
which gets passed to start_routine
.
I know that you can condense multiple arguments into a struct and then pass a pointer to it, but I don't understand why, I couldn't find a single lead that can help me answer the question.