Chris@16: #ifndef BOOST_MEMORY_ORDER_HPP_INCLUDED Chris@16: #define BOOST_MEMORY_ORDER_HPP_INCLUDED Chris@16: Chris@16: // MS compatible compilers support #pragma once Chris@16: Chris@16: #if defined(_MSC_VER) && (_MSC_VER >= 1020) Chris@16: # pragma once Chris@16: #endif Chris@16: Chris@16: // boost/memory_order.hpp Chris@16: // Chris@16: // Defines enum boost::memory_order per the C++0x working draft Chris@16: // Chris@16: // Copyright (c) 2008, 2009 Peter Dimov Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: Chris@16: // Chris@16: // Enum values are chosen so that code that needs to insert Chris@16: // a trailing fence for acquire semantics can use a single Chris@16: // test such as: Chris@16: // Chris@16: // if( mo & memory_order_acquire ) { ...fence... } Chris@16: // Chris@16: // For leading fences one can use: Chris@16: // Chris@16: // if( mo & memory_order_release ) { ...fence... } Chris@16: // Chris@16: // Architectures such as Alpha that need a fence on consume Chris@16: // can use: Chris@16: // Chris@16: // if( mo & ( memory_order_acquire | memory_order_consume ) ) { ...fence... } Chris@16: // Chris@101: // The values are also in the order of increasing "strength" Chris@101: // of the fences so that success/failure orders can be checked Chris@101: // efficiently in compare_exchange methods. Chris@101: // Chris@16: Chris@16: enum memory_order Chris@16: { Chris@16: memory_order_relaxed = 0, Chris@101: memory_order_consume = 1, Chris@101: memory_order_acquire = 2, Chris@101: memory_order_release = 4, Chris@101: memory_order_acq_rel = 6, // acquire | release Chris@101: memory_order_seq_cst = 14 // acq_rel | 8 Chris@16: }; Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #endif // #ifndef BOOST_MEMORY_ORDER_HPP_INCLUDED