]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/sp_interlocked_test.cpp
2 // sp_interlocked_test.cpp
4 // Copyright 2014 Peter Dimov
6 // Distributed under the Boost Software License, Version 1.0.
7 // See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt
11 #if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
13 #include <boost/smart_ptr/detail/sp_interlocked.hpp>
14 #include <boost/detail/lightweight_test.hpp>
18 typedef long long_type
;
22 // On Cygwin 64, long is 64 bit
23 typedef int long_type
;
31 r
= BOOST_SP_INTERLOCKED_INCREMENT( &x
);
36 r
= BOOST_SP_INTERLOCKED_DECREMENT( &x
);
41 r
= BOOST_SP_INTERLOCKED_EXCHANGE( &x
, 3 );
46 r
= BOOST_SP_INTERLOCKED_EXCHANGE_ADD( &x
, 2 );
51 r
= BOOST_SP_INTERLOCKED_COMPARE_EXCHANGE( &x
, 0, 3 );
56 r
= BOOST_SP_INTERLOCKED_COMPARE_EXCHANGE( &x
, 0, 5 );
61 return boost::report_errors();