Technically I think that's okay, because a return from main() implies a pthread_join() on any threads which are still running. I'm not 100% sure though.

EDIT: Nope, I'm wrong.