pthread.h

pthread.h

一 线程是什么

线程从属于进程,进程分配资源,线程执行任务。

二 pthread.h

类型

pthread_t           radioThreadp;
pthread_condattr_t  radioThread_attr;
pthread_cond_t      radioThread_cond;
pthread_mutex_t     radioThread_mutex;

方法

int pthread_create(pthread_t *id, const pthread_attr_t *attr, void *(*)(void *), void *arg);
功能:创建一个线程来运行一个函数。线程创建成功会将j该线程的ID存储到变量id中,并返回0,否则返回非0。
pthread_mutex_init()
pthread_mutex_lock()
pthread_mutex_unlock()
pthread_condattr_init()
pthread_condattr_setclock()
pthread_cond_init()
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值