apue 函数原型 ---线程
来源:互联网 发布:java或且非符号 编辑:程序博客网 时间:2024/06/05 22:47
#include<pthread.h>
1.int pthread_equal(pthread_t tid1,pthread_t tid2);比较两个线程ID,若相等返回非0数值,否则返回0
2.pthread_t pthread_self();返回调用线程ID
3.int pthread_create(pthread_t *restrict tid,const pthread_attr_t *restrict attr,void* (*start_rtn((void*),void *restrict arg);若成功,返回0,否则返回错误编号
4.void pthread_exit(void *rval_ptr);
int pthread_join(pthread_t thread,void ** rval_ptr);成功,返回0,否则返回错误编号
5.int pthread_cancel(pthread_t tid);成功返回0,否则返回错误编号
6.void pthread_cleanup_push(void (*rtn)(void *),void *arg);
void pthread_cleanup_pop(int execute);
7.int pthread_detach(pthread_t tid);(分离线程);
8.int pthread_mutex_init(pthread_mutex_t *mutex,const phread_mutexattr_t *attr)
int pthread_mutex_destroy(pthread_mutex_t *mutex);
9.int pthread_mutex_lock(pthread_mutex_t *mutex);
int phtead_mutex_unlock(pthread_mutex_t *mutex);
int pthread_mutex_trylock(pthread_mutex_t *mutex);
10.int pthread_mutex_timedlock(pthread_mutex_t *mutex,const struct timespec *tsptr);
11.int pthread_rwlock_init(pthread_rwlock_t *rwlock,const pthread_rwlockattr_t *attr);
int pthread_rwlock_destroy(pthread_rwlock_t *rwlock);
12.int pthread_rwlock_rdlock(phtread_rwlock_t *rwlock);
int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock);
int pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock);
int pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock);
int pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock,const struct timespec *tsptr);
int phtread_rwlock_timedwrlock(......)
13,int pthread_cond_init(pthread_cond_t *cond,const pthread_condattr_t *attr);
int pthread_const_destroy(pthread_cond_t *cond);
int pthread_cond_wait(pthread_cond_t *cond,pthread_mutex_t *mut);
int pthread_cond_timewait(pthread_cond_t *cond,pthread_mutex_t *mut,const struct timespec *tsptr);
int pthread_cond_signal(pthread_cond_t *cond);
int pthread_cond_broadcast(pthread_cond_t *cond);
14.int pthread_attr_init(pthread_attr_t *attr);
int pthread_attr_destroy(pthread_attr_t *attr);
15.int pthread_attr_getdetachstate(const pthread_attr_t *attr,int *detachstate);
int pthread_attr_setdetachstate(pthread_attr_t *attr,int *detachstate);
16.#include <signal.h>
int pthread_sigmask(int how,const sigset_t *set,sigset_t *oldset);
how取下列3个值之一:SIG_BLOCK,把信号集添加到线程信号屏蔽字中,SIG_SETMASK,用信号集替换线程的信号屏蔽字,SIG_UNBLOCK,从信号屏蔽字中移除信号集,当前信号屏蔽字存于oldset。
17.#include<signal.h>
int sigwait(const sigset_t *set,int *signop);
线程调用sigwait等待一个或者多个信号的出现(直到信号出现才运行),返回时,signop指向的整数包含发送的信号。
18.#include <signal.h>
int pthread_kill(pthread_t thread,int signo);向指定线程发送信号。
- apue 函数原型 ---线程
- APUE函数笔记九: 线程
- APUE函数笔记十: 线程控制
- 【APUE】8、pthread_create函数,创建子线程
- set_fl()和clr_fl()函数原型 APUE- 各种自定义函数原型
- APUE线程
- APUE-- 线程编程
- APUE学习 线程控制
- [APUE]第十一章 线程
- apue线程学习
- [APUE] 线程和fork
- APUE线程控制
- [APUE] 线程池
- APUE——线程
- APUE 线程 - 程序清单
- APUE笔记 线程
- APUE笔记 线程控制
- apue 第十一章 线程
- MySQL 初识
- 欢迎使用CSDN-markdown编辑器
- hadoop MapReduce序列化
- 关于@requestMapping跳转页面静态资源无法加载问题
- 《step5:tiny-spring-ioc学习五》——ApplicationContext登场
- apue 函数原型 ---线程
- JDK和CGLIB生成动态代理类的区别。
- 线程:死锁
- 7、线程并发库
- ios AudioUnit 录制播放 pcm
- LeetCode ( Minimum Depth of Binary Tree)
- Kotlin数据类(八)
- JavaScript中i.toString(16)的理解,Number.prototype.toString
- JZOJ 1843——小球