1、引入头文件:#include<pthread.h>//开启线程相关头文件#include<stdio.h>
2、编写线程函数:void*tprocess(void*args){ //运行程序体returnNULL;}
3、调用线程函数:pthread_tt;pthread_create(&t,NULL,tprocess,NULL);pthread_join(t,NULL);
时间:2024-10-16 17:16:07
1、引入头文件:#include<pthread.h>//开启线程相关头文件#include<stdio.h>
2、编写线程函数:void*tprocess(void*args){ //运行程序体returnNULL;}
3、调用线程函数:pthread_tt;pthread_create(&t,NULL,tprocess,NULL);pthread_join(t,NULL);