线程值pthread_self函数使用
来源:互联网 发布:基坑设计知乎 编辑:程序博客网 时间:2024/06/08 06:51
#include<stdio.h>
#include<pthread.h>
#include<Windows.h>
#include<signal.h>
#include<process.h>//getpid函数的使用
#pragma comment(lib, "pthreadVC2.lib") //必须加上这句
void*thread_func(void*arg)
{
printf("thread id=%lu\n",pthread_self());
return arg;
}
int main(void){
pid_t pid;
pthread_t tid;
pid = getpid();
printf("process id=%lu\n", pid);
pthread_create(&tid, NULL, thread_func, NULL);
pthread_join(tid,NULL);
return 0;
}
0 0
- 线程值pthread_self函数使用
- 获取线程标识函数gettid和pthread_self的区别
- pthread_create函数 pthread_self 函数
- Linux进程、线程模型,LWP,pthread_self()
- Linux进程、线程模型,LWP,pthread_self()
- 线程pthread_self与gettid 的区别
- Linux进程、线程模型,LWP,pthread_self()
- 嵌入式 线程退出pthread_setcanceltype以及pthread_self以及pthread_cancel
- 2线程原语:pthread_create(),pthread_self(),pthread_exit(),pthread_join(),pthread_cancel(),pthread_detach(
- 线程原语:pthread_create(),pthread_self(),pthread_exit(),pthread_join(),pthread_cancel(),pthread_detach(
- POSIX定时器timer_create()以及线程中的gettid() 和pthread_self()
- 笔记九:线程间的通信(pthread_create()和pthread_self())
- 多线程函数系列pthread_create(), pthread_join(), pthread_self(),pthread_exit(), pthread_detach()实例详解
- POSIX线程,线程的客户/服务通信(pthread_join,pthread_exit,pthread_detach,pthread_self)
- pthread_self 简介
- pthread_detach(pthread_self())
- pthread_self 、pthread_exit
- 创建线程的函数使用
- 利用Git上传本地项目到github---笔记
- 2013年04月12日 JavaEE+物联云计算就业班-上海
- DEV ChartControl绑定DataTable多系列多数据详细讲解
- Matlab symbolic toolbox入门简介
- Servlet.service() for servlet jsp threw exception java.lang.NullPointerException
- 线程值pthread_self函数使用
- HRBUST1313 火影忍者之~静音
- Spark参数配置
- 关于JAVA中子类和父类的构造方法
- Int to Roman
- 判断两个单链表是否相交
- Php开发银行接口之浦发银行
- C++特殊成员变量(静态、常量、引用)的初始化方法
- ActiveMQ学习笔记(一)—— HelloWorld