exit() fails to take the same lock as __cxa_atexit
exit changes the same global data (e.g.__exit_funcs) that __cxa_atexit changes. Shouldn't it take the same lock?
The problem: I see hanging exit() calls in a program that exits on SIGPIPE and write() == -1 in different threads (exit is not called from a signal context, btw.). The problem seems to go away with _exit().
This is on Linux/ia32 with glibc-2.3.2, but the exit function hasn't changed much.