MCPcopy Create free account
hub / github.com/ceph/ceph / run_some

Function run_some

src/test/common/test_ceph_timer.cc:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27namespace {
28template<typename TC>
29void run_some()
30{
31 static constexpr auto MAX_FUTURES = 5;
32 ceph::timer<TC> timer;
33 std::vector<std::future<void>> futures;
34 for (auto i = 0; i < MAX_FUTURES; ++i) {
35 auto t = TC::now() + 2s;
36 std::promise<void> p;
37 futures.push_back(p.get_future());
38 timer.add_event(t, [p = std::move(p)]() mutable {
39 p.set_value();
40 });
41 }
42 for (auto& f : futures)
43 f.get();
44}
45
46template<typename TC>
47void run_orderly()

Callers

nothing calls this directly

Calls 6

set_valueMethod · 0.80
nowFunction · 0.50
push_backMethod · 0.45
get_futureMethod · 0.45
add_eventMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected