Use thr_exit(3C) to terminate a thread. For POSIX threads, see pthread_exit Syntax.
#include <thread.h> void thr_exit(void *status);
thr_exit() does not return to its caller.