Can threads have more than one argument without using a struct?
So... kind of like:
pthread_create(&file_thread, NULL, merge_thread, sortedFiles, number);
... where 'number' is the extra argument?
Thanks, Hristo
Can threads have more than one argument without using a struct?
So... kind of like:
pthread_create(&file_thread, NULL, merge_thread, sortedFiles, number);
... where 'number' is the extra argument?
Thanks, Hristo
No. You'll have to define a struct to contain the various parameters, and pass a pointer to an instance of the struct as the single void*
argument to pthread_create
.