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

Function decrement_to_zero

test/system_timer.cpp:39–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

bindFunction · 0.50
expires_atMethod · 0.45
expiryMethod · 0.45
async_waitMethod · 0.45

Tested by

no test coverage detected