}
TEST(FiberManager, semaphore) {
- constexpr size_t kTasks = 10;
- constexpr size_t kIterations = 10000;
- constexpr size_t kNumTokens = 10;
+ static constexpr size_t kTasks = 10;
+ static constexpr size_t kIterations = 10000;
+ static constexpr size_t kNumTokens = 10;
Semaphore sem(kNumTokens);
int counterA = 0;
int counterB = 0;
- auto task = [&sem, kNumTokens](int& counter, folly::fibers::Baton& baton) {
+ auto task = [&sem](int& counter, folly::fibers::Baton& baton) {
FiberManager manager(std::make_unique<EventBaseLoopController>());
folly::EventBase evb;
dynamic_cast<EventBaseLoopController&>(manager.loopController())
//
// At the end, we verify that exactly one future returning true was seen
// for each iteration.
- constexpr uint32_t numIterations = 1;
+ static constexpr uint32_t numIterations = 1;
auto numThreads = folly::Random::rand32(30, 91);
struct ThreadInfo {
RandomDataHolder::RandomDataHolder(size_t sizeLog2)
: DataHolder(sizeLog2) {
- constexpr size_t numThreadsLog2 = 3;
- constexpr size_t numThreads = size_t(1) << numThreadsLog2;
+ static constexpr size_t numThreadsLog2 = 3;
+ static constexpr size_t numThreads = size_t(1) << numThreadsLog2;
uint32_t seed = randomNumberSeed();
}
TEST(AtomicIntrusiveLinkedList, Stress) {
- constexpr size_t kNumThreads = 32;
- constexpr size_t kNumElements = 100000;
+ static constexpr size_t kNumThreads = 32;
+ static constexpr size_t kNumElements = 100000;
std::vector<TestIntrusiveObject> elements;
for (size_t i = 0; i < kNumThreads * kNumElements; ++i) {
}
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{};