bypass thread::self() and use pthread_self directly