#include<pthread.h>
#include<stdio.h>
#include<stdlib.h>
void* th_fn(void* arg)
{
int* distance = (int*)arg;
int i;
printf("%d\n",*distance);/////////段错误
for(i=0;i<=*distance;i++)
{
printf("%lx run %d\n",pthread_self(),i);
sleep(1);
}
return (void*)0;
}
int distance = *(int*)arg;//也是段错误