23 TestExecutor::TestExecutor(
size_t numThreads) {
24 const auto kWorkers =
std::max(
size_t(1), numThreads);
25 for (
auto idx = 0u; idx < kWorkers; ++idx) {
26 workers_.emplace_back([
this] {
30 unique_lock<mutex> lk(m_);
31 cv_.wait(lk, [
this] {
return !workItems_.empty(); });
44 TestExecutor::~TestExecutor() {
45 for (
auto& worker : workers_) {
50 for (
auto& worker : workers_) {
61 size_t TestExecutor::numThreads()
const {
62 return workers_.size();
65 void TestExecutor::addImpl(
Func f) {
67 lock_guard<mutex>
g(m_);
constexpr detail::Map< Move > move
—— Concurrent Priority Queue Implementation ——
std::condition_variable cv_