diff options
Diffstat (limited to 'boost/asio/detail/atomic_count.hpp')
-rw-r--r-- | boost/asio/detail/atomic_count.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/boost/asio/detail/atomic_count.hpp b/boost/asio/detail/atomic_count.hpp index 9324fffa65..5e0051a22c 100644 --- a/boost/asio/detail/atomic_count.hpp +++ b/boost/asio/detail/atomic_count.hpp @@ -31,10 +31,13 @@ namespace detail { #if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS) typedef long atomic_count; +inline void increment(atomic_count& a, long b) { a += b; } #elif defined(BOOST_ASIO_HAS_STD_ATOMIC) typedef std::atomic<long> atomic_count; +inline void increment(atomic_count& a, long b) { a += b; } #else // defined(BOOST_ASIO_HAS_STD_ATOMIC) typedef boost::detail::atomic_count atomic_count; +inline void increment(atomic_count& a, long b) { while (b > 0) ++a, --b; } #endif // defined(BOOST_ASIO_HAS_STD_ATOMIC) } // namespace detail |