前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >第26章 线程

第26章 线程

作者头像
_gongluck
发布2018-03-09 15:39:51
5730
发布2018-03-09 15:39:51
举报
#include <pthread.h>

//线程
int pthread_create(pthread_t *tid, const pthread_attr_t *attr, void *(*func)(void*), void *arg);
int pthread_join(pthread_t *tid, void **status);
pthread_t pthread_self(void);
int pthread_detach(pthread_t tid);
void pthread_exit(void *status);

//线程特定数据
int pthread_once(pthread_once_t *onceptr/*PTHREAD_ONCE_INIT*/, void (*init)(void));
int pthread_key_create(pthread_key_t *keyptr, void (*destructor)(void *value));
void *pthread_getspecific(pthread_key_t key);
int pthread_setspecific(pthread_key_t key, const void *value);

//互斥锁
int pthread_mutex_lock(pthread_mutex_t *mptr);
int pthread_mutex_unlock(pthread_mutex_t *mptr);

//条件变量
int pthread_cond_wait(pthread_cond_t *cptr, pthread_mutex_t *mptr);
int pthread_cond_signal(pthread_cond_t *cptr);
int pthread_cond_broadcast(pthread_cond_t *cptr);
int pthread_cond_timedwait(pthread_cond_t *cptr, pthread_mutex_t *mptr, const struct timespec *abstime);//gettimeofday clock_gettime
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017年11月20日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档