| 101 | |
| 102 | template<typename TC> |
| 103 | void 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 | |
| 118 | template<typename TC> |
| 119 | void cancellation() |
no test coverage detected