mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
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:
@@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
@@ -59,6 +58,16 @@
|
|||||||
|
|
||||||
const pthread_attr_t g_default_pthread_attr = PTHREAD_ATTR_INITIALIZER;
|
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
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -92,8 +101,8 @@ static inline void pthread_tcb_setup(FAR struct pthread_tcb_s *ptcb,
|
|||||||
#if CONFIG_TASK_NAME_SIZE > 0
|
#if CONFIG_TASK_NAME_SIZE > 0
|
||||||
/* Copy the pthread name into the TCB */
|
/* Copy the pthread name into the TCB */
|
||||||
|
|
||||||
snprintf(ptcb->cmn.name, CONFIG_TASK_NAME_SIZE,
|
strncpy(ptcb->cmn.name, g_pthreadname, CONFIG_TASK_NAME_SIZE);
|
||||||
"pt-%p", ptcb->cmn.entry.pthread);
|
ptcb->cmn.name[CONFIG_TASK_NAME_SIZE] = '\0';
|
||||||
#endif /* CONFIG_TASK_NAME_SIZE */
|
#endif /* CONFIG_TASK_NAME_SIZE */
|
||||||
|
|
||||||
/* For pthreads, args are strictly pass-by-value; that actual
|
/* For pthreads, args are strictly pass-by-value; that actual
|
||||||
|
|||||||
Reference in New Issue
Block a user