c++ overlay of pthread