X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Ftest%2FThreadCachedIntTest.cpp;h=8709abf60321c7efcf4b297af7c76656979e0e16;hb=327ee770028d0e28e51958eb0c635342407b6b06;hp=588aa52eeb84ea1a291a8eb834ad2e9309f885ba;hpb=34a2f64fb65d4cb446e4ac7623a777191bffa43f;p=folly.git diff --git a/folly/test/ThreadCachedIntTest.cpp b/folly/test/ThreadCachedIntTest.cpp index 588aa52e..8709abf6 100644 --- a/folly/test/ThreadCachedIntTest.cpp +++ b/folly/test/ThreadCachedIntTest.cpp @@ -18,15 +18,16 @@ #include #include +#include #include #include #include -#include #include #include #include +#include using namespace folly; @@ -70,7 +71,7 @@ void Runner(Counter* counter, uint32_t iterations) { } } } -} +} // namespace // Slow test with fewer threads where there are more busy waits and // many calls to readFull(). This attempts to test as many of the @@ -86,7 +87,8 @@ TEST_F(ThreadCachedIntTest, MultithreadedSlow) { // iteration, threads[1] performs 2 iterations, threads[2] performs // 3 iterations, and so on. for (uint32_t i = 0; i < kNumThreads; ++i) { - threads[i].reset(new std::thread(Runner, &g_counter_for_mt_slow, i + 1)); + threads[i] = + std::make_unique(Runner, &g_counter_for_mt_slow, i + 1); } // Variable to grab current counter value. int32_t counter_value; @@ -141,7 +143,8 @@ TEST_F(ThreadCachedIntTest, MultithreadedFast) { // iteration, threads[1] performs 2 iterations, threads[2] performs // 3 iterations, and so on. for (uint32_t i = 0; i < kNumThreads; ++i) { - threads[i].reset(new std::thread(Runner, &g_counter_for_mt_fast, i + 1)); + threads[i] = + std::make_unique(Runner, &g_counter_for_mt_fast, i + 1); } // Let the threads run to completion. {