MCPcopy Create free account
hub / github.com/boostorg/asio / cancel_timer

Method cancel_timer

include/boost/asio/detail/timer_queue.hpp:184–202  ·  view source on GitHub ↗

Cancel and dequeue operations for the given timer.

Source from the content-addressed store, hash-verified

182
183 // Cancel and dequeue operations for the given timer.
184 std::size_t cancel_timer(per_timer_data& timer, op_queue<operation>& ops,
185 std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)())
186 {
187 std::size_t num_cancelled = 0;
188 if (timer.prev_ != 0 || &timer == timers_)
189 {
190 while (wait_op* op = (num_cancelled != max_cancelled)
191 ? timer.op_queue_.front() : 0)
192 {
193 op->ec_ = boost::asio::error::operation_aborted;
194 timer.op_queue_.pop();
195 ops.push(op);
196 ++num_cancelled;
197 }
198 if (timer.op_queue_.empty())
199 remove_timer(timer);
200 }
201 return num_cancelled;
202 }
203
204 // Cancel and dequeue a specific operation for the given timer.
205 void cancel_timer_by_key(per_timer_data* timer,

Callers

nothing calls this directly

Calls 4

frontMethod · 0.80
popMethod · 0.45
pushMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected