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

Function decrement_to_zero

test/deadline_timer.cpp:38–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void decrement_to_zero(boost::asio::deadline_timer* t, int* count)
39{
40 if (*count > 0)
41 {
42 --(*count);
43
44 int before_value = *count;
45
46 t->expires_at(t->expires_at() + seconds(1));
47 t->async_wait(boost::bind(decrement_to_zero, t, count));
48
49 // Completion cannot nest, so count value should remain unchanged.
50 BOOST_ASIO_CHECK(*count == before_value);
51 }
52}
53
54void increment_if_not_cancelled(int* count,
55 const boost::system::error_code& ec)

Callers

nothing calls this directly

Calls 3

bindFunction · 0.50
expires_atMethod · 0.45
async_waitMethod · 0.45

Tested by

no test coverage detected