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

Function cancel_all

src/test/common/test_ceph_timer.cc:103–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101
102template<typename TC>
103void cancel_all()
104{
105 ceph::timer<TC> timer;
106 static constexpr auto MAX_FUTURES = 5;
107 std::vector<std::future<void>> futures;
108 for (auto i = 0; i < MAX_FUTURES; ++i) {
109 std::promise<void> p;
110 futures.push_back(p.get_future());
111 timer.add_event(100s + i*1s, Destructo(std::move(p)));
112 }
113 timer.cancel_all_events();
114 for (auto& f : futures)
115 f.get();
116}
117
118template<typename TC>
119void cancellation()

Callers 1

~RedisPoolMethod · 0.85

Calls 6

DestructoClass · 0.85
push_backMethod · 0.45
get_futureMethod · 0.45
add_eventMethod · 0.45
cancel_all_eventsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected