From googling and observing, I think pthread_exit in the main thread will wait for all threads to finish. It also causes exit, so we can no longer pass an error condition back