replace pthread_* functions with std::* variants