/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <folly/detail/CacheLocality.h>
-#include <sched.h>
#include <memory>
#include <thread>
#include <unordered_map>
+
#include <glog/logging.h>
+
#include <folly/Benchmark.h>
using namespace folly::detail;
ready++;
while (!go.load()) {
- sched_yield();
+ std::this_thread::yield();
}
std::atomic<int> localWork(0);
for (size_t i = iters; i > 0; --i) {
}
while (ready < numThreads) {
- sched_yield();
+ std::this_thread::yield();
}
braces.dismiss();
go = true;
while (threads.size() < numThreads) {
threads.push_back(std::thread([&]() {
while (!go.load()) {
- sched_yield();
+ std::this_thread::yield();
}
std::atomic<size_t> localCounter(0);
std::atomic<int> localWork(0);