码迷,mamicode.com
首页 > 编程语言 > 详细

Linux多线程基本函数

时间:2019-08-10 00:03:10      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:ons   style   多线程   res   nbsp   默认   参数   文件   start   

按照所学的进度会不断更新...虽然学的可能有点慢

1、pthread_create():创建线程

头文件:#include<pthread.h>

函数声明:

int pthread_create(pthread_t *restrict tidp, //新创建的线程ID指向的内存单元
           const pthread_attr_t *restrict_attr, //设置线程属性,默认为NULL
           void*(*start_rtn)(void*), //新创建的线程从start_rtn函数的地址开始运行
           void *restrict arg);//默认为NULL,若上述函数需要参数,将参数放入结构中并将地址作为arg传入

返回值:若创建成功返回0,否则返回出错编号

 

Linux多线程基本函数

标签:ons   style   多线程   res   nbsp   默认   参数   文件   start   

原文地址:https://www.cnblogs.com/z1014601153/p/11329823.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!