#include <folly/IndexedMemPool.h>
#include <folly/test/DeterministicSchedule.h>
+#include <folly/portability/GTest.h>
+#include <folly/portability/Unistd.h>
+
#include <string>
#include <thread>
-#include <unistd.h>
#include <semaphore.h>
-#include <gflags/gflags.h>
-#include <gtest/gtest.h>
using namespace folly;
using namespace folly::test;
}
struct NonTrivialStruct {
- static __thread int count;
+ static FOLLY_TLS int count;
int elem_;
}
};
-__thread int NonTrivialStruct::count;
+FOLLY_TLS int NonTrivialStruct::count;
TEST(IndexedMemPool, eager_recycle) {
typedef IndexedMemPool<NonTrivialStruct> Pool;
}
EXPECT_EQ(NonTrivialStruct::count, 0);
}
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
- gflags::ParseCommandLineFlags(&argc, &argv, true);
- return RUN_ALL_TESTS();
-}