Unix pthread_create() manual page.
https://man7.org/linux/man-pages/man3/pthread_create.3.html
The new thread terminates in one of the following ways:
(...)
* It returns from start_routine(). This is equivalent to calling pthread_exit(3) with the value supplied in
the return statement.
(...)
Calling pthread_exit(0) is optional.
--
MSDN _beginthreadex() documentation:
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/beginthread-beginthreadex?view=msvc-160
"When the thread returns from that routine, it is terminated automatically."
Calling _endthreadex(0) is optional. |