[PATCH] Make exit thread-safe

Jan Kratochvil lace@jankratochvil.net
Thu Feb 24 09:57:00 GMT 2005


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



More information about the Libc-alpha mailing list