From 833de50e2b8c267291e218e5ad6053cbf672eb8e Mon Sep 17 00:00:00 2001 From: chrysn Date: Wed, 25 Jan 2023 15:18:34 +0100 Subject: [PATCH] thread: Zombification is NORETURN when called from threads --- core/include/thread.h | 3 +++ core/sched.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/core/include/thread.h b/core/include/thread.h index 233f7a07fe..018f721648 100644 --- a/core/include/thread.h +++ b/core/include/thread.h @@ -356,6 +356,9 @@ THREAD_MAYBE_INLINE void thread_yield_higher(void); * but its scheduler entry and stack will be kept. * A zombie state thread is supposed to be cleaned up * by @ref thread_kill_zombie(). + * + * This function would be NORETURN, but its no-op behavior inside an + * ISR precludes such an annotation. */ void thread_zombify(void); diff --git a/core/sched.c b/core/sched.c index 7265ef9772..cee962c865 100644 --- a/core/sched.c +++ b/core/sched.c @@ -320,6 +320,8 @@ NORETURN void sched_task_exit(void) sched_num_threads--; thread_zombify(); + /* We're in a thread, so thread_zombify is really NORETURN. */ + UNREACHABLE(); } #ifdef MODULE_SCHED_CB