Yeah (redhat 7.2), on linux a pthread is an implementation of a LinuxThread isn't it.
The problem is intermittent, but I know how to reproduce now.
I'll see if I can reproduce with the code you posted. I'll post the results.
vVv, what's the effect of calling _exit before or directly after pthread_exit? I mean, pthread_exit just cleans up the thread resources, and according to my man page, _exit sends SIGCHLD signal to processes inherited by the init process etc.