remove pthread, add standard c++ thread