Futex::futexWait returns FutexResult
[folly.git] / folly / test / SingletonThreadLocalTest.cpp
index f3e0ace020749a4e5e2f8aaa7e55587f7a04b05a..8397bb88e2c0f0cb7b31ca437e6fcee23a528dde 100644 (file)
@@ -37,21 +37,20 @@ struct Foo {
 };
 using FooSingletonTL = SingletonThreadLocal<Foo>;
 FooSingletonTL theFooSingleton;
-}
+} // namespace
 
 TEST(SingletonThreadLocalTest, OneSingletonPerThread) {
-  const std::size_t targetThreadCount{64};
+  static constexpr std::size_t targetThreadCount{64};
   std::atomic<std::size_t> completedThreadCount{0};
   Synchronized<std::unordered_set<Foo*>> fooAddresses{};
   std::vector<std::thread> threads{};
-  auto threadFunction =
-      [&fooAddresses, targetThreadCount, &completedThreadCount] {
-        fooAddresses.wlock()->emplace(&FooSingletonTL::get());
-        ++completedThreadCount;
-        while (completedThreadCount < targetThreadCount) {
-          std::this_thread::yield();
-        }
-      };
+  auto threadFunction = [&fooAddresses, &completedThreadCount] {
+    fooAddresses.wlock()->emplace(&FooSingletonTL::get());
+    ++completedThreadCount;
+    while (completedThreadCount < targetThreadCount) {
+      std::this_thread::yield();
+    }
+  };
   {
     for (std::size_t threadCount{0}; threadCount < targetThreadCount;
          ++threadCount) {