1 #ifndef BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED
2 #define BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED
4 // MS compatible compilers support #pragma once
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
11 // boost/detail/atomic_count_win32.hpp
13 // Copyright (c) 2001-2005 Peter Dimov
15 // Distributed under the Boost Software License, Version 1.0. (See
16 // accompanying file LICENSE_1_0.txt or copy at
17 // http://www.boost.org/LICENSE_1_0.txt)
20 #include <boost/detail/interlocked.hpp>
32 explicit atomic_count( long v ): value_( v )
38 return BOOST_INTERLOCKED_INCREMENT( &value_ );
43 return BOOST_INTERLOCKED_DECREMENT( &value_ );
48 return static_cast<long const volatile &>( value_ );
53 atomic_count( atomic_count const & );
54 atomic_count & operator=( atomic_count const & );
63 #endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED