Ticket #9426: boost_1_55_0_atomic_gcc_cas_no_opt.patch

File boost_1_55_0_atomic_gcc_cas_no_opt.patch, 4.3 KB (added by Piotr Kobzda <pikob@…>, 9 years ago)
  • boost_1_55_0/boost/atomic/detail/cas32strong.hpp

    diff -Nura original/boost_1_55_0/boost/atomic/detail/cas32strong.hpp boost_1_55_0/boost/atomic/detail/cas32strong.hpp
    old new  
    658658    }
    659659
    660660    void
    661     store(value_type const& v, memory_order order = memory_order_seq_cst) ) volatile BOOST_NOEXCEPT
     661    store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
    662662    {
    663663        storage_type tmp = 0;
    664664        memcpy(&tmp, &v, sizeof(value_type));
     
    679679    }
    680680
    681681    value_type
    682     exchange(value_type const& v, memory_order order = memory_order_seq_cst) ) volatile BOOST_NOEXCEPT
     682    exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
    683683    {
    684684        value_type original = load(memory_order_relaxed);
    685685        do {
     
    692692        value_type & expected,
    693693        value_type const& desired,
    694694        memory_order success_order,
    695         memory_order failure_order) ) volatile BOOST_NOEXCEPT
     695        memory_order failure_order) volatile BOOST_NOEXCEPT
    696696    {
    697697        return compare_exchange_strong(expected, desired, success_order, failure_order);
    698698    }
     
    702702        value_type & expected,
    703703        value_type const& desired,
    704704        memory_order success_order,
    705         memory_order failure_order) ) volatile BOOST_NOEXCEPT
     705        memory_order failure_order) volatile BOOST_NOEXCEPT
    706706    {
    707707        storage_type expected_s = 0, desired_s = 0;
    708708        memcpy(&expected_s, &expected, sizeof(value_type));
     
    755755    }
    756756
    757757    void
    758     store(value_type const& v, memory_order order = memory_order_seq_cst) ) volatile BOOST_NOEXCEPT
     758    store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
    759759    {
    760760        storage_type tmp = 0;
    761761        memcpy(&tmp, &v, sizeof(value_type));
     
    776776    }
    777777
    778778    value_type
    779     exchange(value_type const& v, memory_order order = memory_order_seq_cst) ) volatile BOOST_NOEXCEPT
     779    exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
    780780    {
    781781        value_type original = load(memory_order_relaxed);
    782782        do {
  • boost_1_55_0/boost/atomic/detail/gcc-cas.hpp

    diff -Nura original/boost_1_55_0/boost/atomic/detail/gcc-cas.hpp boost_1_55_0/boost/atomic/detail/gcc-cas.hpp
    old new  
    104104    return success;
    105105}
    106106
     107}
     108}
     109
    107110class atomic_flag
    108111{
    109112private:
     
    129132        do {
    130133            if (expected == 1)
    131134                break;
    132         } while (!atomics::detail::platform_cmpxchg32(expected, (uint32_t)1, &v_));
     135        } while (!atomics::detail::platform_cmpxchg32_strong(expected, (uint32_t)1, &v_));
    133136        atomics::detail::platform_fence_after(order);
    134137        return expected;
    135138    }
     
    138141#define BOOST_ATOMIC_FLAG_LOCK_FREE 2
    139142
    140143}
    141 }
    142 }
    143144
    144145#include <boost/atomic/detail/base.hpp>
    145146
     
    148149#define BOOST_ATOMIC_CHAR_LOCK_FREE 2
    149150#define BOOST_ATOMIC_SHORT_LOCK_FREE 2
    150151#define BOOST_ATOMIC_INT_LOCK_FREE 2
    151 #define BOOST_ATOMIC_LONG_LOCK_FREE (sizeof(long) <= 4 ? 2 : 0)
    152 #define BOOST_ATOMIC_LLONG_LOCK_FREE (sizeof(long long) <= 4 ? 2 : 0)
    153 #define BOOST_ATOMIC_POINTER_LOCK_FREE (sizeof(void *) <= 4 ? 2 : 0)
     152#define BOOST_ATOMIC_LONG_LOCK_FREE (__SIZEOF_LONG__ <= 4 ? 2 : 0)
     153#define BOOST_ATOMIC_LLONG_LOCK_FREE (__SIZEOF_LONG_LONG__ <= 4 ? 2 : 0)
     154#define BOOST_ATOMIC_POINTER_LOCK_FREE (__SIZEOF_POINTER__ <= 4 ? 2 : 0)
    154155#define BOOST_ATOMIC_BOOL_LOCK_FREE 2
    155156
    156157#include <boost/atomic/detail/cas32strong.hpp>
  • boost_1_55_0/boost/atomic/detail/platform.hpp

    diff -Nura original/boost_1_55_0/boost/atomic/detail/platform.hpp boost_1_55_0/boost/atomic/detail/platform.hpp
    old new  
    5757
    5858    #include <boost/atomic/detail/windows.hpp>
    5959
    60 #elif 0 && defined(__GNUC__) /* currently does not work correctly */
     60#elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 401)
    6161
    62     #include <boost/atomic/detail/base.hpp>
    6362    #include <boost/atomic/detail/gcc-cas.hpp>
    6463
    6564#else