API of getting thread name

NAME

pthread_setname_np, pthread_getname_np - set/get the name of a thread  

SYNOPSIS

#define _GNU_SOURCE             /* See feature_test_macros(7) */
#include <pthread.h>
int pthread_setname_np(pthread_t thread, const char *name);
int pthread_getname_np(pthread_t thread,
                       const char *name, size_t len);

the pthread_t thread can be obtained by pthread_self()

from: https://www.systutorials.com/docs/linux/man/3-pthread_setname_np/
ref: https://blog.csdn.net/Decisiveness/article/details/58343302

posted @ 2018-09-27 18:38  aspirs  阅读(153)  评论(0编辑  收藏  举报