![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/include/boost/atomic/detail/ |
Upload File : |
/* * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * Copyright (c) 2017 Andrey Semashev */ /*! * \file atomic/detail/extra_ops_msvc_arm.hpp * * This header contains implementation of the extra atomic operations for ARM. */ #ifndef BOOST_ATOMIC_DETAIL_EXTRA_OPS_MSVC_ARM_HPP_INCLUDED_ #define BOOST_ATOMIC_DETAIL_EXTRA_OPS_MSVC_ARM_HPP_INCLUDED_ #include <cstddef> #include <boost/memory_order.hpp> #include <boost/atomic/detail/config.hpp> #include <boost/atomic/detail/interlocked.hpp> #include <boost/atomic/detail/storage_type.hpp> #include <boost/atomic/detail/extra_operations_fwd.hpp> #include <boost/atomic/detail/extra_ops_generic.hpp> #include <boost/atomic/capabilities.hpp> #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif namespace boost { namespace atomics { namespace detail { #if defined(BOOST_ATOMIC_INTERLOCKED_BTS) && defined(BOOST_ATOMIC_INTERLOCKED_BTR) template< typename Base, std::size_t Size, bool Signed > struct extra_operations< Base, 4u, Signed, true > : public generic_extra_operations< Base, 4u, Signed > { typedef generic_extra_operations< Base, 4u, Signed > base_type; typedef typename base_type::storage_type storage_type; static BOOST_FORCEINLINE bool bit_test_and_set(storage_type volatile& storage, unsigned int bit_number, memory_order order) BOOST_NOEXCEPT { #if defined(BOOST_ATOMIC_INTERLOCKED_BTS_RELAXED) && defined(BOOST_ATOMIC_INTERLOCKED_BTS_ACQUIRE) && defined(BOOST_ATOMIC_INTERLOCKED_BTS_RELEASE) bool result; switch (order) { case memory_order_relaxed: result = !!BOOST_ATOMIC_INTERLOCKED_BTS_RELAXED(&storage, bit_number); break; case memory_order_consume: case memory_order_acquire: result = !!BOOST_ATOMIC_INTERLOCKED_BTS_ACQUIRE(&storage, bit_number); break; case memory_order_release: result = !!BOOST_ATOMIC_INTERLOCKED_BTS_RELEASE(&storage, bit_number); break; case memory_order_acq_rel: case memory_order_seq_cst: default: result = !!BOOST_ATOMIC_INTERLOCKED_BTS(&storage, bit_number); break; } return result; #else return !!BOOST_ATOMIC_INTERLOCKED_BTS(&storage, bit_number); #endif } static BOOST_FORCEINLINE bool bit_test_and_reset(storage_type volatile& storage, unsigned int bit_number, memory_order order) BOOST_NOEXCEPT { #if defined(BOOST_ATOMIC_INTERLOCKED_BTR_RELAXED) && defined(BOOST_ATOMIC_INTERLOCKED_BTR_ACQUIRE) && defined(BOOST_ATOMIC_INTERLOCKED_BTR_RELEASE) bool result; switch (order) { case memory_order_relaxed: result = !!BOOST_ATOMIC_INTERLOCKED_BTR_RELAXED(&storage, bit_number); break; case memory_order_consume: case memory_order_acquire: result = !!BOOST_ATOMIC_INTERLOCKED_BTR_ACQUIRE(&storage, bit_number); break; case memory_order_release: result = !!BOOST_ATOMIC_INTERLOCKED_BTR_RELEASE(&storage, bit_number); break; case memory_order_acq_rel: case memory_order_seq_cst: default: result = !!BOOST_ATOMIC_INTERLOCKED_BTR(&storage, bit_number); break; } return result; #else return !!BOOST_ATOMIC_INTERLOCKED_BTR(&storage, bit_number); #endif } }; #endif // defined(BOOST_ATOMIC_INTERLOCKED_BTS) && defined(BOOST_ATOMIC_INTERLOCKED_BTR) } // namespace detail } // namespace atomics } // namespace boost #endif // BOOST_ATOMIC_DETAIL_EXTRA_OPS_MSVC_ARM_HPP_INCLUDED_