您当前的位置: 首页 >  linux

DS小龙哥

暂无认证

  • 1浏览

    0关注

    679博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Linux系统编程-(pthread)线程的使用案例(分离属性、清理函数等)

DS小龙哥 发布时间:2022-01-09 22:00:00 ,浏览量:1

这篇文章介绍Linux下线程的创建与基本使用案例,主要是案例代码为主;相关的函数详细介绍在上篇文章里已经介绍过了。

1. 案例代码: 线程的创建

下面这份代码演示如何创建线程。在编译的时候需要加上-lpthread

函数原型:

#include 
int pthread_create
(
pthread_t *thread, 
const pthread_attr_t *attr,
void *(*start_routine) 
关注
打赏
1664009229
查看更多评论
立即登录/注册

微信扫码登录

0.0413s