Use pthread_name instead of pthread_self for portability