From 9e3ebf4033740191675fecde0d3fdb473e525b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 6 Oct 2005 08:43:10 +0000 Subject: [PATCH] exit_thread() no longer sends a signal when it's called from a kernel thread - instead, it will exit directly to have the same behaviour as in user space (where it doesn't return to the caller, since signals are handled before returning to user space). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14309 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/thread.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/thread.c b/src/system/kernel/thread.c index da90b82115..bb8c75607f 100644 --- a/src/system/kernel/thread.c +++ b/src/system/kernel/thread.c @@ -1382,7 +1382,13 @@ exit_thread(status_t returnValue) thread->exit.status = returnValue; thread->exit.reason = THREAD_RETURN_EXIT; - send_signal_etc(thread->id, SIGKILLTHR, B_DO_NOT_RESCHEDULE); + // if called from a kernel thread, we don't deliver the signal, + // we just exit directly to keep the user space behaviour of + // this function + if (thread->team != team_get_kernel_team()) + send_signal_etc(thread->id, SIGKILLTHR, B_DO_NOT_RESCHEDULE); + else + thread_exit(); }