【发布时间】:2015-05-14 09:40:54
【问题描述】:
我想在main()中调用多个函数并处理它们的返回值(使用pthread_join),但它们都是int函数,具有多个非void参数,pthread_create 的定义为:
int pthread_create(pthread_t * thread,
const pthread_attr_t * attr,
void * (*start_routine)(void *),
void *arg);
我在网上找到的start_routine 的所有示例都是void * 类型,类型为单个void * 参数,是否可以在pthread_create 中调用具有多个非空类型参数的int 函数?
【问题讨论】:
-
您尝试了一些无效的方法吗?
-
如果我使用int函数,编译时会报错
-
显示函数decl,并显示exact错误。简而言之,展示您尝试过的任何不起作用的东西,并且请请将它放在您的问题中,而不是在 cmets 中。