pthread_create 创建线程
pthread_exit 退出线程
pthread_cancel 取消线程
pthread_join 等待线程
pthread_detach 分离线程
pthread_cancel(tid);
void *ptr = NULL;
pthread_join(tid,&ptr);
分离线程,指定线程退出后自动释放资源
初始化互斥量pthread_mutex_init
mutex
pthread_mutex_lock--加锁操作
临界资源的操作
pthread_mutex_unlock--解锁操作

被折叠的 条评论
为什么被折叠?



