留言与评论(共有 0 条评论) |
发布时间:2020-04-12 08:40:53
用 pthread_t创建线程名字。然后pthread_create开辟线程。具体使用。比如有一个函数 void *hello(){printf("create pthread!
");},然后在main函数里面调用,int main(){pthread_t a_thread;pthread_create(&a_thread, NULL, (void *)hello, NULL);}这样就完成了hello()函数的创建和使用,接下来hello函数就会在一个线程中运行
留言与评论(共有 0 条评论) |
全站搜索