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
This commit is contained in:
Axel Dörfler
2005-10-06 08:43:10 +00:00
parent 8d3256a4ad
commit 9e3ebf4033
+7 -1
View File
@@ -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();
}