exit() terminates the calling thread, and the process if it's the last /
only thread in the process. exitgroup() termintates the calling process
leaving it in the zombie state for wait() to reap. for more info see
exit(2) and exit_group(2).
Internally, exit() and exit_group() issue the POSIX_THREAD_EXIT_EVENT
and POSIX_PROCESS_EXIT_EVENT respectively, to notify libraries that have
registered event handlers to these events.