add usage of pthread_self