[英]Can threads have more than one argument?
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? ...“ number”是多余的参数吗?
Thanks, Hristo 谢谢,克里斯托
否。您必须定义一个结构以包含各种参数,并将指针作为该pthread_create
的单个void*
参数传递给该结构的实例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.