You may add

pthread_detach(pthread_self());
to the body of your thread function.