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

Function cancellation

src/test/common/test_ceph_timer.cc:119–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118template<typename TC>
119void cancellation()
120{
121 ceph::timer<TC> timer;
122 {
123 std::promise<void> p;
124 auto f = p.get_future();
125 auto e = timer.add_event(100s, Destructo(std::move(p)));
126 EXPECT_TRUE(timer.cancel_event(e));
127 }
128 {
129 std::promise<void> p;
130 auto f = p.get_future();
131 auto e = timer.add_event(1s, [p = std::move(p)]() mutable {
132 p.set_value();
133 });
134 f.get();
135 EXPECT_FALSE(timer.cancel_event(e));
136 }
137}
138
139template<typename TC>
140void tick(ceph::timer<TC>* t,

Callers

nothing calls this directly

Calls 6

DestructoClass · 0.85
set_valueMethod · 0.80
get_futureMethod · 0.45
add_eventMethod · 0.45
cancel_eventMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected