Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

thread group c++

  std::vector<std::thread> grp;

  // to create threads
  grp.emplace_back(functor); // pass in the argument of std::thread()

  void join_all() {
    for (auto& thread : grp)
      if (thread.joinable())
        thread.join();
  }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #thread #group
ADD COMMENT
Topic
Name
2+1 =