这里要注意的是
1.pthread_create()原型:
int
pthread_create(pthread_t *
thread
,
const
pthread_attr_t *attr,
void
*(*start_routine) (
void
*),
void
*arg);
其中,最后一个参数要传入给线程里的函数的参数地址。为了代码严谨,程序里的pthread_create ()的最后个参数可以写成(void *)&a.
pthread_jion()里的第二个参数是NULL或者是一个指针。线程里的函数调用的返回值 并不要求是指针。可以是void,int.