PTHREAD_KILL_OTHER_THREADS_NPSection: C Library Functions (3)Updated: LinuxThreads |
PTHREAD_KILL_OTHER_THREADS_NPSection: C Library Functions (3)Updated: LinuxThreads |
void pthread_kill_other_threads_np(void);
Termination of the other threads is not performed through pthread_cancel(3) and completely bypasses the cancellation mechanism. Hence, the current settings for cancellation state and cancellation type are ignored, and the cleanup handlers are not executed in the terminated threads.
According to POSIX 1003.1c, a successful exec* in one of the threads should terminate automatically all other threads in the program. This behavior is not yet implemented in LinuxThreads. Calling pthread_kill_other_threads_np before exec* achieves much of the same behavior, except that if exec* ultimately fails, then all other threads are already killed.