Open wanlizhu opened 5 years ago
for example, the following test case will fail:
TEST(ThreadPool, Case1) { ThreadPool pool(4); int x = 1;
auto res = pool.enqueue([](int& y){ y = 99; }, x); res.get(); EXPECT_EQ(x, 99);
}
I think std::ref is needed here. https://en.cppreference.com/w/cpp/utility/functional/ref
Thanks for your answer, it is correct now
could you please close this issue, as it seems solved now?
for example, the following test case will fail:
TEST(ThreadPool, Case1) { ThreadPool pool(4); int x = 1;
}