摘要: 参考链接:https://baike.baidu.com/item/pthread_join 函数pthread_join用来等待一个线程的结束,线程间同步的操作。 头文件 : #include <pthread.h> 函数定义: int pthread_join(pthread_t thread, 阅读全文
posted @ 2020-06-19 15:42 Ruigel1 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 获取进程ID: 原型: #include <unistd.h>pid_t getpid(void); 返回调用进程的进程ID。 获取线程ID: 原型: #include <pthread.h>pthread_t pthread_self(void); 返回调用线程的线程ID。 阅读全文
posted @ 2020-06-19 15:32 Ruigel1 阅读(1194) 评论(0) 推荐(0) 编辑
摘要: pthread_create是类Unix操作系统(Unix、Linux、Mac OS X等)的创建线程的函数。它的功能是创建线程(实际上就是确定调用该线程函数的入口点),在线程创建以后,就开始运行相关的线程函数。 头文件: #include<pthread.h> 函数原型: int pthread_ 阅读全文
posted @ 2020-06-19 15:28 Ruigel1 阅读(11565) 评论(0) 推荐(1) 编辑