The purpose of pthread_exit() is to return the exit code if any other threads join.
From the manual:
Performing a return from the start function of any thread other than the main thread results in an implicit call to pthread_exit(), using the function's return value as the thread exit status.
So, it does not matter if you are not using it.
source share