Terminates the calling kernel thread.
#include <sys/thread.h>
void thread_terminate ()
The thread_terminate kernel service terminates the calling kernel thread and cleans up its structure and its kernel stack. If it is the last thread in the process, the process will exit.
The thread_terminate kernel service is automatically called when a thread returns from its entry point routine (defined in the call to the kthread_start kernel service).
The thread_terminate kernel service can be called from the process environment only.
The thread_terminate kernel service never returns.