This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v8 0/8] Add support for ISO C threads.h [thrd_exit]
Regarding thrd_exit, the new documentation is saying:
If this function is called from a single thread process, the call to
this function is equivalent to @code{exit(0)}. Returning from a
thread-start function is equivalent to calling @code{thrd_exit}.
The standard says:
The program shall terminate normally after the last thread has been
terminated. The behavior shall be as if the program called the exit
function with the status EXIT_SUCCESS at thread termination time.
I came up with:
If this function is called from a single-threaded process, the call is
equivalent to calling @code{exit} with @code{EXIT_SUCCESS}
(@pxref{Normal Termination}). Also note that returning from a function
that started a thread is equivalent to calling @code{thrd_exit}.
but I don't feel like the first sentence of each of those quite lines
up. I suppose "single-threaded" and "last thread" could be used
interchangeably, but I don't think it gives the same impression. Also,
the standard doesn't mention the function case. Seems like a good
point, but maybe I'm not reading "thread-start function" right.
Any suggestions?
Thanks,
Rical