Revert "pthread: Change the default name from <pthread> to <0xyyyyyyyy>"

This reverts commit 092d23b25d.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21 2022-12-13 09:26:28 +08:00 committed by Xiang Xiao
parent aac0228c74
commit 3d2ffed8ae
1 changed files with 12 additions and 3 deletions

View File

@ -26,7 +26,6 @@
#include <sys/types.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <sched.h>
@ -59,6 +58,16 @@
const pthread_attr_t g_default_pthread_attr = PTHREAD_ATTR_INITIALIZER;
/****************************************************************************
* Private Data
****************************************************************************/
#if CONFIG_TASK_NAME_SIZE > 0
/* This is the name for name-less pthreads */
static const char g_pthreadname[] = "<pthread>";
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
@ -92,8 +101,8 @@ static inline void pthread_tcb_setup(FAR struct pthread_tcb_s *ptcb,
#if CONFIG_TASK_NAME_SIZE > 0
/* Copy the pthread name into the TCB */
snprintf(ptcb->cmn.name, CONFIG_TASK_NAME_SIZE,
"pt-%p", ptcb->cmn.entry.pthread);
strncpy(ptcb->cmn.name, g_pthreadname, CONFIG_TASK_NAME_SIZE);
ptcb->cmn.name[CONFIG_TASK_NAME_SIZE] = '\0';
#endif /* CONFIG_TASK_NAME_SIZE */
/* For pthreads, args are strictly pass-by-value; that actual