mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
pthread: Change the default name from <pthread> to <0xyyyyyyyy>
since it's very easy to identify thread through entry pointer Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -57,16 +57,6 @@
|
||||
|
||||
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
|
||||
****************************************************************************/
|
||||
@@ -98,8 +88,8 @@ static inline void pthread_argsetup(FAR struct pthread_tcb_s *tcb,
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
/* Copy the pthread name into the TCB */
|
||||
|
||||
strncpy(tcb->cmn.name, g_pthreadname, CONFIG_TASK_NAME_SIZE);
|
||||
tcb->cmn.name[CONFIG_TASK_NAME_SIZE] = '\0';
|
||||
snprintf(tcb->cmn.name, CONFIG_TASK_NAME_SIZE,
|
||||
"pt-%p", tcb->cmn.entry.pthread);
|
||||
#endif /* CONFIG_TASK_NAME_SIZE */
|
||||
|
||||
/* For pthreads, args are strictly pass-by-value; that actual
|
||||
|
||||
Reference in New Issue
Block a user