Added pthread_detach() for auto deletable threads