2012-05-13から1日間の記事一覧
boost::threadじゃなくて、std::threadでのスレッドプログラム。 #include <thread> std::mutex m; void th_do(int i) { std::lock_guard<std::mutex> lk(m); std::cout << "do! : " << i << std::endl; } int main() { std::vector<std::thread> threads; for (int i = 0; i < 5; ++i) { thre</std::thread></std::mutex></thread>…