This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] Make exit thread-safe
- From: Jan Kratochvil <lace at jankratochvil dot net>
- To: Sripathi Kodi <sripathik at in dot ibm dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Thu, 24 Feb 2005 10:39:49 +0100
- Subject: Re: [PATCH] Make exit thread-safe
- References: <421D9C7C.70601@in.ibm.com>
Hi,
On Thu, 24 Feb 2005 10:21:00 +0100, Sripathi Kodi wrote:
...
> I have noticed that exit() in stdlib/exit.c is not thread-safe.
pthread_create(3):
The new thread terminates either explicitly, by calling
pthread_exit(3), or implicitly, by returning from the start_routine
function.
No note of any use of exit(3) there. exit(3) is just not suitable to be used in
threads. Even after fork(3) you use _exit(3) and not exit(3).
Regards,
Lace