xiaoweiChen / CPP-Concurrency-In-Action-2ed-2019

:book: 作为对《C++ Concurrency in Action - SECOND EDITION》的中文翻译。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

9.2.5代码错误

weikano opened this issue · comments

template<typename T>
void interruptible_wait(std::future<T>& uf)
{
  while(!this_thread_interrupt_flag.is_set())
  {
    //future.wait_for没有接收lock类型参数的方法
    //if(uf.wait_for(lk,std::chrono::milliseconds(1)==
    //   std::future_status::ready)
    if(uf.wait_for(std::chrono::milliseconds(1)) == std::future_status::ready) {
      break;
    }
  }
  interruption_point();
}

这里的确是少一个反括号,已经加上去了