#include <stdio.h>
#include <pthread.h>
void* worker(void* arg){
printf("hello, I'm a threading \n");
}
int main(){
pthread_t tid;
int ret;
ret = pthread_create(&tid, NULL, worker, NULL);
if(ret != 0){
printf("error: 线程创建失败\n");
return -1;
}
printf("the thread id is %lu \n",tid);
pthread_join(tid, NULL);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxwdGhyZWFkLmg+Cgp2b2lkKiB3b3JrZXIodm9pZCogYXJnKXsKICAgIHByaW50ZigiaGVsbG8sIEknbSBhIHRocmVhZGluZyBcbiIpOyAKfQoKaW50IG1haW4oKXsKICAgIHB0aHJlYWRfdCB0aWQ7CiAgICBpbnQgcmV0OwoKICAgIHJldCA9IHB0aHJlYWRfY3JlYXRlKCZ0aWQsIE5VTEwsIHdvcmtlciwgTlVMTCk7CiAgICBpZihyZXQgIT0gMCl7CiAgICAgICAgcHJpbnRmKCJlcnJvcjog57q/56iL5Yib5bu65aSx6LSlXG4iKTsKICAgICAgICByZXR1cm4gLTE7CiAgICB9CiAgICBwcmludGYoInRoZSB0aHJlYWQgaWQgaXMgJWx1IFxuIix0aWQpOwoKICAgIHB0aHJlYWRfam9pbih0aWQsIE5VTEwpOwogICAgcmV0dXJuIDA7Cn0=