The detached attribute merely determines the behavior of the system when the thread terminates; it does not prevent the thread from being terminated if the process terminates using exit(3) (or equivalently, if the main thread returns). https://man7.org/linux/man-pages/man3/pthread_detach.3.html |
exit_group - exit all threads in a process Since glibc 2.3, this is the system call invoked when the _exit(2) wrapper function is called. https://man7.org/linux/man-pages/man2/exit_group.2.html |
|
|
Separates the thread of execution from the thread object, allowing execution to continue independently. Any allocated resources will be freed once the thread exits https://en.cppreference.com/w/cpp/thread/thread/detach |