1 // 2 // detail/atomic_count.hpp 3 // ~~~~~~~~~~~~~~~~~~~~~~~ 4 // 5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 // 7 // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 // 10 11 #ifndef ASIO_DETAIL_ATOMIC_COUNT_HPP 12 #define ASIO_DETAIL_ATOMIC_COUNT_HPP 13 14 15 #include "asio/detail/config.hpp" 16 17 # include <atomic> 18 19 namespace asio { 20 namespace detail { 21 22 typedef std::atomic<long> atomic_count; increment(atomic_count & a,long b)23inline void increment(atomic_count& a, long b) { a += b; } 24 25 } // namespace detail 26 } // namespace asio 27 28 #endif // ASIO_DETAIL_ATOMIC_COUNT_HPP 29