diff options
| author | vitalyisaev <[email protected]> | 2023-11-14 09:58:56 +0300 |
|---|---|---|
| committer | vitalyisaev <[email protected]> | 2023-11-14 10:20:20 +0300 |
| commit | c2b2dfd9827a400a8495e172a56343462e3ceb82 (patch) | |
| tree | cd4e4f597d01bede4c82dffeb2d780d0a9046bd0 /contrib/restricted/boost/filesystem/src/atomic_tools.hpp | |
| parent | d4ae8f119e67808cb0cf776ba6e0cf95296f2df7 (diff) | |
YQ Connector: move tests from yql to ydb (OSS)
Перенос папки с тестами на Коннектор из папки yql в папку ydb (синхронизируется с github).
Diffstat (limited to 'contrib/restricted/boost/filesystem/src/atomic_tools.hpp')
| -rw-r--r-- | contrib/restricted/boost/filesystem/src/atomic_tools.hpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/contrib/restricted/boost/filesystem/src/atomic_tools.hpp b/contrib/restricted/boost/filesystem/src/atomic_tools.hpp new file mode 100644 index 00000000000..a60e5d325aa --- /dev/null +++ b/contrib/restricted/boost/filesystem/src/atomic_tools.hpp @@ -0,0 +1,69 @@ +// atomic_tools.hpp ------------------------------------------------------------------// + +// Copyright 2021 Andrey Semashev + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +// See library home page at http://www.boost.org/libs/filesystem + +//--------------------------------------------------------------------------------------// + +#ifndef BOOST_FILESYSTEM_SRC_ATOMIC_TOOLS_HPP_ +#define BOOST_FILESYSTEM_SRC_ATOMIC_TOOLS_HPP_ + +#include <boost/filesystem/config.hpp> + +#if !defined(BOOST_FILESYSTEM_SINGLE_THREADED) + +#include "atomic_ref.hpp" + +namespace boost { +namespace filesystem { +namespace detail { + +//! Atomically loads the value +template< typename T > +BOOST_FORCEINLINE T atomic_load_relaxed(T& a) +{ + return atomic_ns::atomic_ref< T >(a).load(atomic_ns::memory_order_relaxed); +} + +//! Atomically stores the value +template< typename T > +BOOST_FORCEINLINE void atomic_store_relaxed(T& a, T val) +{ + atomic_ns::atomic_ref< T >(a).store(val, atomic_ns::memory_order_relaxed); +} + +} // namespace detail +} // namespace filesystem +} // namespace boost + +#else // !defined(BOOST_FILESYSTEM_SINGLE_THREADED) + +namespace boost { +namespace filesystem { +namespace detail { + +//! Atomically loads the value +template< typename T > +BOOST_FORCEINLINE T atomic_load_relaxed(T const& a) +{ + return a; +} + +//! Atomically stores the value +template< typename T > +BOOST_FORCEINLINE void atomic_store_relaxed(T& a, T val) +{ + a = val; +} + +} // namespace detail +} // namespace filesystem +} // namespace boost + +#endif // !defined(BOOST_FILESYSTEM_SINGLE_THREADED) + +#endif // BOOST_FILESYSTEM_SRC_ATOMIC_TOOLS_HPP_ |
