Refactors parallel barrier test
authorPeizhao Ou <peizhaoo@uci.edu>
Tue, 13 Mar 2018 00:29:05 +0000 (17:29 -0700)
committerPeizhao Ou <peizhaoo@uci.edu>
Tue, 13 Mar 2018 00:29:05 +0000 (17:29 -0700)
test/stress/misc/barrier_driver.cpp

index 8dfc41dc8fef3502d23642845f4b8e312dc10157..272e3c43d3eef3253d5fa3fb469432923479b577 100644 (file)
@@ -48,8 +48,8 @@ TEST_F(BarrierTest, Wait) {
     threads.push_back(std::thread(Thread));
   }
 
-  for (size_t i = 0; i < s_nBarrierThreadCount; i++) {
-    threads[i].join();
+  for (auto& thrd : threads) {
+    thrd.join();
   }
   EXPECT_EQ(count, s_nBarrierPassCount);
   delete barrier;