kernel: add a new API for setting thread names

Added k_thread_name_set() and enable thread name setting when declaring
static threads. This is enabled only when THREAD_MONITOR is used. System
threads get a name by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2018-03-03 02:31:05 -06:00
commit 57554055d2
8 changed files with 113 additions and 24 deletions

View file

@ -236,6 +236,10 @@ static ALWAYS_INLINE void _new_thread_init(struct k_thread *thread,
thread->custom_data = NULL;
#endif
#ifdef CONFIG_THREAD_NAME
thread->name = NULL;
#endif
#if defined(CONFIG_USERSPACE)
thread->mem_domain_info.mem_domain = NULL;
#endif /* CONFIG_USERSPACE */