25 using namespace folly;
41 return [&]()
mutable {
42 auto p = std::make_shared<Promise<Unit>>();
43 p->setInterruptHandler(
49 return p->getFuture();
62 std::queue<std::shared_ptr<Promise<Unit>>> ps;
66 bool complete =
false;
70 auto thunk =
makeThunk(ps, interrupt, ps_mutex);
72 .thenValue([&](
auto&&)
mutable { complete =
true; })
90 std::queue<std::shared_ptr<Promise<Unit>>> ps;
94 bool complete =
false;
98 auto thunk =
makeThunk(ps, interrupt, ps_mutex);
100 .thenValue([&](
auto&&)
mutable { complete =
true; })
108 auto p2 = ps.front();
112 p2->setException(eggs);
120 std::queue<std::shared_ptr<Promise<Unit>>> ps;
123 bool complete =
false;
124 bool failure =
false;
128 auto thunk =
makeThunk(ps, interrupt, ps_mutex);
130 .thenValue([&](
auto&&)
mutable { complete =
true; })
138 for (
int j = 1; j <= 3; ++j) {
Future< Unit > whileDo(P &&predicate, F &&thunk)
#define EXPECT_EQ(val1, val2)
std::function< Future< Unit >void)> makeThunk(std::queue< std::shared_ptr< Promise< Unit >>> &ps, int &interrupt, std::mutex &ps_mutex)
—— Concurrent Priority Queue Implementation ——
#define EXPECT_TRUE(condition)
static eggs_t eggs("eggs")
void popAndFulfillPromise(std::queue< std::shared_ptr< Promise< Unit >>> &ps, std::mutex &ps_mutex)
#define EXPECT_FALSE(condition)
TEST(SequencedExecutor, CPUThreadPoolExecutor)
std::function< bool(void)> makePred(int &i)