Use thr_exit(3THR) to terminate a thread. (For POSIX threads, see pthread_exit(3THR).)
#include <thread.h> void thr_exit(void *status);