From f57bc1d0347151b3e84c962515a201b3c308aed9 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Tue, 23 Aug 2016 13:34:56 -0700 Subject: [PATCH] Fix lambda expression for clang/windows Summary: make the variables static so capturing is unnecessary since I couldn't find a portable way to capture variables in a lambda that's converted to a C-style pointer-to-function. Test Plan: https://ci.appveyor.com/project/Facebook/rocksdb/build/1.0.1658 Subscribers: andrewkr, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D62403 --- util/thread_local_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/thread_local_test.cc b/util/thread_local_test.cc index 6506edcf5..7bf008193 100644 --- a/util/thread_local_test.cc +++ b/util/thread_local_test.cc @@ -461,12 +461,12 @@ TEST_F(ThreadLocalTest, Fold) { auto unref = [](void* ptr) { delete static_cast*>(ptr); }; - const int kNumThreads = 16; - const int kItersPerThread = 10; + static const int kNumThreads = 16; + static const int kItersPerThread = 10; port::Mutex mu; port::CondVar cv(&mu); Params params(&mu, &cv, nullptr, kNumThreads, unref); - auto func = [&](void* ptr) { + auto func = [](void* ptr) { auto& p = *static_cast(ptr); ASSERT_TRUE(p.tls1.Get() == nullptr); p.tls1.Reset(new std::atomic(0));