文章分类 - 自调
摘要:i am main threadi am thread 2i am thread 1join1 rval is 0 //成功join2 rval is 22 //失败,已经分离了,连接的话就会错误thread1 err code is 1 thread2 err code id -121690931
阅读全文
摘要:三种: 1、从启动线程中退出,返回值是线程的退出码 2、线程可以被同一进程中的其他线程取消 3、pthread_exit(void *val)函数 切记,不要使用exit\Exit\_exit函数,他们会结束整个进程
阅读全文
摘要:#include"stdio.h" #include"string.h" #include"stdlib.h" #include"pthread.h" struct student{ //给新的线程传递一个结构体:main线程可以传递参数 int age; char name[20]; }; void *thread_fun(void *stu) { sleep(1)...
阅读全文
摘要:输入命令: ibus-daemon -drx 即可。
阅读全文
浙公网安备 33010602011771号