diff -Nura original/boost_1_55_0/boost/atomic/detail/cas32strong.hpp boost_1_55_0/boost/atomic/detail/cas32strong.hpp
old
|
new
|
|
658 | 658 | } |
659 | 659 | |
660 | 660 | 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 |
662 | 662 | { |
663 | 663 | storage_type tmp = 0; |
664 | 664 | memcpy(&tmp, &v, sizeof(value_type)); |
… |
… |
|
679 | 679 | } |
680 | 680 | |
681 | 681 | 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 |
683 | 683 | { |
684 | 684 | value_type original = load(memory_order_relaxed); |
685 | 685 | do { |
… |
… |
|
692 | 692 | value_type & expected, |
693 | 693 | value_type const& desired, |
694 | 694 | memory_order success_order, |
695 | | memory_order failure_order) ) volatile BOOST_NOEXCEPT |
| 695 | memory_order failure_order) volatile BOOST_NOEXCEPT |
696 | 696 | { |
697 | 697 | return compare_exchange_strong(expected, desired, success_order, failure_order); |
698 | 698 | } |
… |
… |
|
702 | 702 | value_type & expected, |
703 | 703 | value_type const& desired, |
704 | 704 | memory_order success_order, |
705 | | memory_order failure_order) ) volatile BOOST_NOEXCEPT |
| 705 | memory_order failure_order) volatile BOOST_NOEXCEPT |
706 | 706 | { |
707 | 707 | storage_type expected_s = 0, desired_s = 0; |
708 | 708 | memcpy(&expected_s, &expected, sizeof(value_type)); |
… |
… |
|
755 | 755 | } |
756 | 756 | |
757 | 757 | 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 |
759 | 759 | { |
760 | 760 | storage_type tmp = 0; |
761 | 761 | memcpy(&tmp, &v, sizeof(value_type)); |
… |
… |
|
776 | 776 | } |
777 | 777 | |
778 | 778 | 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 |
780 | 780 | { |
781 | 781 | value_type original = load(memory_order_relaxed); |
782 | 782 | do { |
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
|
|
104 | 104 | return success; |
105 | 105 | } |
106 | 106 | |
| 107 | } |
| 108 | } |
| 109 | |
107 | 110 | class atomic_flag |
108 | 111 | { |
109 | 112 | private: |
… |
… |
|
129 | 132 | do { |
130 | 133 | if (expected == 1) |
131 | 134 | break; |
132 | | } while (!atomics::detail::platform_cmpxchg32(expected, (uint32_t)1, &v_)); |
| 135 | } while (!atomics::detail::platform_cmpxchg32_strong(expected, (uint32_t)1, &v_)); |
133 | 136 | atomics::detail::platform_fence_after(order); |
134 | 137 | return expected; |
135 | 138 | } |
… |
… |
|
138 | 141 | #define BOOST_ATOMIC_FLAG_LOCK_FREE 2 |
139 | 142 | |
140 | 143 | } |
141 | | } |
142 | | } |
143 | 144 | |
144 | 145 | #include <boost/atomic/detail/base.hpp> |
145 | 146 | |
… |
… |
|
148 | 149 | #define BOOST_ATOMIC_CHAR_LOCK_FREE 2 |
149 | 150 | #define BOOST_ATOMIC_SHORT_LOCK_FREE 2 |
150 | 151 | #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) |
154 | 155 | #define BOOST_ATOMIC_BOOL_LOCK_FREE 2 |
155 | 156 | |
156 | 157 | #include <boost/atomic/detail/cas32strong.hpp> |
diff -Nura original/boost_1_55_0/boost/atomic/detail/platform.hpp boost_1_55_0/boost/atomic/detail/platform.hpp
old
|
new
|
|
57 | 57 | |
58 | 58 | #include <boost/atomic/detail/windows.hpp> |
59 | 59 | |
60 | | #elif 0 && defined(__GNUC__) /* currently does not work correctly */ |
| 60 | #elif BOOST_ATOMIC_ALLOW_GCC_CAS && defined(__GNUC__) /* currently may not work correctly */ |
61 | 61 | |
62 | | #include <boost/atomic/detail/base.hpp> |
63 | 62 | #include <boost/atomic/detail/gcc-cas.hpp> |
64 | 63 | |
65 | 64 | #else |