linux c用prctl给线程命名
来源:互联网 发布:淘宝客全店推广 编辑:程序博客网 时间:2024/05/21 04:21
#include <stdio.h> #include <pthread.h> #include <sys/prctl.h> void* tmain(void * arg) { printf("tmain\n") ; char name[ 32] ; prctl(PR_SET_NAME, (unsigned long) "thread_name" ) ; prctl(PR_GET_NAME, (unsigned long) name) ; printf("%s\n", name) ; while (1) sleep (1) ; } //linux c用prctl给线程命名// ps -L -p 3105int main(void) {printf("pid=%d\n",getpid()) ; // 设置可ptraceprctl(PR_SET_DUMPABLE, 1, 0, 0, 0);pthread_t tid; pthread_create ( & tid, NULL , tmain, NULL ) ; pthread_join ( tid, NULL ) ; return 0; }
0 0
- linux c用prctl给线程命名
- 用prctl给线程命名
- 用prctl给线程命名
- 用prctl给线程命名
- 用prctl给线程命名
- 用prctl给线程命名
- 用prctl给线程命名
- 用prctl给线程命名
- 用prctl给线程命名
- 用prctl给线程命名 【源码实现】
- 用prctl定制你的线程
- 给线程命名
- 如何给线程命名
- SetThreadName & GetThreadName 给线程命名
- prctl
- prctl
- linux 编程--prctl()函数应用
- prctl 设置线程名字,可以方便调试
- 计算机原理学习(7)-- x86-32 CPU和内存管理之分段管理
- Android Volley完全解析,带你从源码的角度理解Volley
- solr 请求失败 Http Error 413
- Scala 特性
- 清算存储虚拟化的五宗罪和五个好
- linux c用prctl给线程命名
- 动态数组
- 解决Vysor黑屏问题
- arduino花式点灯续
- PHP简单的分页类
- 钟馗之眼-ZoomEye-Python
- 你用过“Yes”和“No”徽章吗?
- 自定义view——折线图
- 欢迎使用CSDN-markdown编辑器