void thread_run(void *arg) { struct argument *arg_thread1;/*这里定义了一个指向argument类型结构体的指针arg_thread1,用它来接收传过来的参数的地址*/ arg_thread1=(struct argument *)arg; int size = arg_thread1->e_port - arg_thread1->s_port + 2; int *result = (int *)malloc(sizeof(int)*size); scan_r(arg_thread1->ip, arg_thread1->s_port, arg_thread1->e_port, result); res[arg_thread1->i] = result; pthread_exit(NULL); }
void thread_run(void *arg) { struct argument *arg_thread;/*argument value including target info*/ arg_thread=(struct argument *)arg; int size = arg_thread->e_port - arg_thread->s_port + 2; int *result = (int *)malloc(sizeof(int)*size); scan_r(arg_thread->ip, arg_thread->s_port, arg_thread->e_port, result); res[arg_thread->i] = result; pthread_exit(NULL); }