#include#include int func(int x) { printf("in func\\n"); sleep(5); printf("out func\\n"); return 0; }struct S_AAA{ int n; int (*f)(int x); };void * thr_fn(void *arg) { printf("in thr_fn\\n"); struct S\_AAA \*psa = (struct S\_AAA\*)arg; psa->f(1); printf("out thr_fn\\n"); return; }void main() { printf(".......\\n"); struct S_AAA sa; sa.n=0; sa.f=func; pthread_t tid1; int err1=pthread\_create(&tid1,NULL,thr\_fn,&sa); if(err1!=0) { printf("create thread fail!\\n"); } pthread_t tid2; int err2=pthread\_create(&tid2,NULL,thr\_fn,&sa); if(err2!=0) { printf("create thread fail!\\n"); } pthread_join(tid1,NULL); pthread_join(tid2,NULL); }