diff --git a/core/include/thread.h b/core/include/thread.h index 7e9294f4dd..d59cabb2bf 100644 --- a/core/include/thread.h +++ b/core/include/thread.h @@ -447,10 +447,11 @@ char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_sta */ void thread_add_to_list(list_node_t *list, thread_t *thread); -#ifdef DEVELHELP /** * @brief Returns the name of a process * + * @note when compiling without DEVELHELP, this *always* returns NULL! + * * @param[in] pid the PID of the thread to get the name from * * @return the threads name @@ -458,6 +459,7 @@ void thread_add_to_list(list_node_t *list, thread_t *thread); */ const char *thread_getname(kernel_pid_t pid); +#ifdef DEVELHELP /** * @brief Measures the stack usage of a stack * diff --git a/core/thread.c b/core/thread.c index 0009463ff1..6f7a71362e 100644 --- a/core/thread.c +++ b/core/thread.c @@ -44,13 +44,16 @@ int thread_getstatus(kernel_pid_t pid) return t ? (int) t->status : STATUS_NOT_FOUND; } -#ifdef DEVELHELP const char *thread_getname(kernel_pid_t pid) { +#ifdef DEVELHELP volatile thread_t *t = thread_get(pid); return t ? t->name : NULL; -} +#else + (void)pid; + return NULL; #endif +} void thread_sleep(void) {