diff --git a/core/sched.c b/core/sched.c index 236c58e764..7265ef9772 100644 --- a/core/sched.c +++ b/core/sched.c @@ -319,10 +319,7 @@ NORETURN void sched_task_exit(void) sched_threads[thread_getpid()] = NULL; sched_num_threads--; - sched_set_status(thread_get_active(), STATUS_STOPPED); - - sched_active_thread = NULL; - cpu_switch_context_exit(); + thread_zombify(); } #ifdef MODULE_SCHED_CB