| 30 | } |
| 31 | |
| 32 | void decrement_to_zero(thread_pool* pool, int* count) |
| 33 | { |
| 34 | if (*count > 0) |
| 35 | { |
| 36 | --(*count); |
| 37 | |
| 38 | int before_value = *count; |
| 39 | boost::asio::post(*pool, bindns::bind(decrement_to_zero, pool, count)); |
| 40 | |
| 41 | // Handler execution cannot nest, so count value should remain unchanged. |
| 42 | BOOST_ASIO_CHECK(*count == before_value); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | void nested_decrement_to_zero(thread_pool* pool, int* count) |
| 47 | { |