OLD | NEW |
1 // -*- C++ -*- | 1 // -*- C++ -*- |
2 //===--------------------------- atomic -----------------------------------===// | 2 //===--------------------------- atomic -----------------------------------===// |
3 // | 3 // |
4 // The LLVM Compiler Infrastructure | 4 // The LLVM Compiler Infrastructure |
5 // | 5 // |
6 // This file is distributed under the University of Illinois Open Source | 6 // This file is distributed under the University of Illinois Open Source |
7 // License. See LICENSE.TXT for details. | 7 // License. See LICENSE.TXT for details. |
8 // | 8 // |
9 //===----------------------------------------------------------------------===// | 9 //===----------------------------------------------------------------------===// |
10 | 10 |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 // general atomic<T> | 811 // general atomic<T> |
812 | 812 |
813 template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::valu
e> | 813 template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::valu
e> |
814 struct __atomic_base // false | 814 struct __atomic_base // false |
815 { | 815 { |
816 mutable _Atomic(_Tp) __a_; | 816 mutable _Atomic(_Tp) __a_; |
817 | 817 |
818 // @LOCALMOD-BEGIN The NaCl builtin delays resolution of the lock-free | 818 // @LOCALMOD-BEGIN The NaCl builtin delays resolution of the lock-free |
819 // property until translation time (time at which the | 819 // property until translation time (time at which the |
820 // actual target is known). | 820 // actual target is known). |
821 #if defined (__pnacl__) | 821 #if defined (__pnacl__) || (defined(__mips__) && defined (__native_client__)) |
822 _LIBCPP_INLINE_VISIBILITY | 822 _LIBCPP_INLINE_VISIBILITY |
823 bool is_lock_free() const volatile _NOEXCEPT | 823 bool is_lock_free() const volatile _NOEXCEPT |
824 {return __nacl_atomic_is_lock_free(sizeof(_Tp), &__a_);} | 824 {return __nacl_atomic_is_lock_free(sizeof(_Tp), &__a_);} |
825 _LIBCPP_INLINE_VISIBILITY | 825 _LIBCPP_INLINE_VISIBILITY |
826 bool is_lock_free() const _NOEXCEPT | 826 bool is_lock_free() const _NOEXCEPT |
827 {return __nacl_atomic_is_lock_free(sizeof(_Tp), &__a_);} | 827 {return __nacl_atomic_is_lock_free(sizeof(_Tp), &__a_);} |
828 #else | 828 #else |
829 _LIBCPP_INLINE_VISIBILITY | 829 _LIBCPP_INLINE_VISIBILITY |
830 bool is_lock_free() const volatile _NOEXCEPT | 830 bool is_lock_free() const volatile _NOEXCEPT |
831 {return __c11_atomic_is_lock_free(sizeof(_Tp));} | 831 {return __c11_atomic_is_lock_free(sizeof(_Tp));} |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1791 #define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE | 1791 #define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE |
1792 #define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE | 1792 #define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE |
1793 | 1793 |
1794 #endif // !__has_feature(cxx_atomic) | 1794 #endif // !__has_feature(cxx_atomic) |
1795 | 1795 |
1796 _LIBCPP_END_NAMESPACE_STD | 1796 _LIBCPP_END_NAMESPACE_STD |
1797 | 1797 |
1798 #endif // !_LIBCPP_HAS_NO_THREADS | 1798 #endif // !_LIBCPP_HAS_NO_THREADS |
1799 | 1799 |
1800 #endif // _LIBCPP_ATOMIC | 1800 #endif // _LIBCPP_ATOMIC |
OLD | NEW |