std::async

class PointCloudPub{

    bool PubPointCloud(const std::string &cloud);

};


std::future send_future_;

if(!send_future_.valid())

    send_future_ = std::async(&PointCloudPub::PubPointCloud, ptrPoint2Car, map);
else{
    auto fut_status = send_future_ .wait_for(std::chrono::microseconds(5));
	if(fut_status == std::future_status::ready){
	    std::cout << ", send bright eye std::future_status::ready" << std::endl;
}

 

std::async - cppreference.com

你可能感兴趣的:(前端,算法,javascript)