std::async

class PointCloudPub{

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

};


std::future<bool> 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

相关推荐

最近更新

  1. TCP协议是安全的吗?

    2023-12-08 00:48:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2023-12-08 00:48:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2023-12-08 00:48:02       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2023-12-08 00:48:02       20 阅读

热门阅读

  1. shell/bash 让vi/vim显示空格,及tab字符

    2023-12-08 00:48:02       39 阅读
  2. Python 作业答疑_6.15~6.18

    2023-12-08 00:48:02       41 阅读
  3. mysql 全文索引中的Stopwords

    2023-12-08 00:48:02       39 阅读