diff options
| author | arkady-e1ppa <[email protected]> | 2024-10-14 17:25:51 +0300 |
|---|---|---|
| committer | arkady-e1ppa <[email protected]> | 2024-10-14 17:40:51 +0300 |
| commit | 3b92e669413cdc39137dbfd1d23417b23ef276ef (patch) | |
| tree | 8e5709b2cbef24a7f0b42ad82574252896bb2dc7 | |
| parent | d74394815fdeebaee897571642e270f3d459557e (diff) | |
Move atomic object to library/cpp/yt/threading
[nodiff:caesar]
commit_hash:446e45e0378f6b2cb31d85bcc3e4516efbdfe5a7
| -rw-r--r-- | library/cpp/yt/threading/atomic_object-inl.h (renamed from yt/yt/core/misc/atomic_object-inl.h) | 8 | ||||
| -rw-r--r-- | library/cpp/yt/threading/atomic_object.h (renamed from yt/yt/core/misc/atomic_object.h) | 10 | ||||
| -rw-r--r-- | yt/yt/client/api/rpc_proxy/connection_impl.h | 2 | ||||
| -rw-r--r-- | yt/yt/client/logging/dynamic_table_log_writer.cpp | 2 | ||||
| -rw-r--r-- | yt/yt/core/bus/tcp/connection.h | 2 | ||||
| -rw-r--r-- | yt/yt/core/rpc/bus/channel.cpp | 2 | ||||
| -rw-r--r-- | yt/yt/core/rpc/per_user_request_queue_provider.h | 2 | ||||
| -rw-r--r-- | yt/yt/core/test_framework/test_proxy_service.h | 2 | ||||
| -rw-r--r-- | yt/yt/core/ytree/ypath_service.cpp | 2 | ||||
| -rw-r--r-- | yt/yt/library/tracing/jaeger/tracer.h | 2 |
10 files changed, 17 insertions, 17 deletions
diff --git a/yt/yt/core/misc/atomic_object-inl.h b/library/cpp/yt/threading/atomic_object-inl.h index bf91bb6f879..452f5a0bc77 100644 --- a/yt/yt/core/misc/atomic_object-inl.h +++ b/library/cpp/yt/threading/atomic_object-inl.h @@ -54,16 +54,16 @@ bool TAtomicObject<T>::CompareExchange(T& expected, const T& desired) } template <class T> -template <class R, CInvocable<R(T&)> F> -R TAtomicObject<T>::Transform(const F& func) +template <std::invocable<T&> F> +std::invoke_result_t<F, T&> TAtomicObject<T>::Transform(const F& func) { auto guard = WriterGuard(Spinlock_); return func(Object_); } template <class T> -template <class R, CInvocable<R(const T&)> F> -R TAtomicObject<T>::Read(const F& func) const +template <std::invocable<const T&> F> +std::invoke_result_t<F, const T&> TAtomicObject<T>::Read(const F& func) const { auto guard = ReaderGuard(Spinlock_); return func(Object_); diff --git a/yt/yt/core/misc/atomic_object.h b/library/cpp/yt/threading/atomic_object.h index 3f8f406a140..e986f872a08 100644 --- a/yt/yt/core/misc/atomic_object.h +++ b/library/cpp/yt/threading/atomic_object.h @@ -2,7 +2,7 @@ #include <library/cpp/yt/threading/rw_spin_lock.h> -#include <library/cpp/yt/misc/concepts.h> +#include <concepts> namespace NYT { @@ -32,12 +32,12 @@ public: bool CompareExchange(T& expected, const T& desired); //! Atomically transforms the value with function #func. - template <class R = void, CInvocable<R(T&)> F> - R Transform(const F& func); + template <std::invocable<T&> F> + std::invoke_result_t<F, T&> Transform(const F& func); //! Atomicaly reads the value with function #func. - template <class R = void, CInvocable<R(const T&)> F> - R Read(const F& func) const; + template <std::invocable<const T&> F> + std::invoke_result_t<F, const T&> Read(const F& func) const; T Load() const; diff --git a/yt/yt/client/api/rpc_proxy/connection_impl.h b/yt/yt/client/api/rpc_proxy/connection_impl.h index 576b655870c..92d1f5b4ec9 100644 --- a/yt/yt/client/api/rpc_proxy/connection_impl.h +++ b/yt/yt/client/api/rpc_proxy/connection_impl.h @@ -9,7 +9,7 @@ #include <yt/yt/core/rpc/public.h> // TODO(prime@): Create HTTP endpoint for discovery that works without authentication. -#include <yt/yt/core/misc/atomic_object.h> +#include <library/cpp/yt/threading/atomic_object.h> #include <yt/yt/core/service_discovery/public.h> diff --git a/yt/yt/client/logging/dynamic_table_log_writer.cpp b/yt/yt/client/logging/dynamic_table_log_writer.cpp index 1ff8ff680bc..c6c731f2dde 100644 --- a/yt/yt/client/logging/dynamic_table_log_writer.cpp +++ b/yt/yt/client/logging/dynamic_table_log_writer.cpp @@ -24,7 +24,7 @@ #include <yt/yt/core/logging/formatter.h> #include <yt/yt/core/logging/system_log_event_provider.h> -#include <yt/yt/core/misc/atomic_object.h> +#include <library/cpp/yt/threading/atomic_object.h> #include <yt/yt/core/misc/proc.h> #include <library/cpp/yt/memory/atomic_intrusive_ptr.h> diff --git a/yt/yt/core/bus/tcp/connection.h b/yt/yt/core/bus/tcp/connection.h index 2948d20b676..421216ed812 100644 --- a/yt/yt/core/bus/tcp/connection.h +++ b/yt/yt/core/bus/tcp/connection.h @@ -15,7 +15,7 @@ #include <yt/yt/core/net/address.h> -#include <yt/yt/core/misc/atomic_object.h> +#include <library/cpp/yt/threading/atomic_object.h> #include <yt/yt/core/misc/blob.h> #include <yt/yt/core/misc/mpsc_stack.h> #include <yt/yt/core/misc/ring_queue.h> diff --git a/yt/yt/core/rpc/bus/channel.cpp b/yt/yt/core/rpc/bus/channel.cpp index f3959aed7b6..294d6545286 100644 --- a/yt/yt/core/rpc/bus/channel.cpp +++ b/yt/yt/core/rpc/bus/channel.cpp @@ -19,7 +19,7 @@ #include <yt/yt/core/concurrency/thread_affinity.h> #include <yt/yt/core/misc/finally.h> -#include <yt/yt/core/misc/atomic_object.h> +#include <library/cpp/yt/threading/atomic_object.h> #include <yt/yt/core/tracing/public.h> diff --git a/yt/yt/core/rpc/per_user_request_queue_provider.h b/yt/yt/core/rpc/per_user_request_queue_provider.h index 84a3b0389c6..7a68315a010 100644 --- a/yt/yt/core/rpc/per_user_request_queue_provider.h +++ b/yt/yt/core/rpc/per_user_request_queue_provider.h @@ -7,7 +7,7 @@ #include <yt/yt/library/profiling/sensor.h> #include <yt/yt/library/syncmap/map.h> -#include <yt/yt/core/misc/atomic_object.h> +#include <library/cpp/yt/threading/atomic_object.h> namespace NYT::NRpc { diff --git a/yt/yt/core/test_framework/test_proxy_service.h b/yt/yt/core/test_framework/test_proxy_service.h index 3f2c99415e8..26c0bde1735 100644 --- a/yt/yt/core/test_framework/test_proxy_service.h +++ b/yt/yt/core/test_framework/test_proxy_service.h @@ -10,7 +10,7 @@ #include <yt/yt/core/logging/log.h> -#include <yt/yt/core/misc/atomic_object.h> +#include <library/cpp/yt/threading/atomic_object.h> #include <yt/yt/core/ytree/attributes.h> diff --git a/yt/yt/core/ytree/ypath_service.cpp b/yt/yt/core/ytree/ypath_service.cpp index b078379c813..212fb9f76fd 100644 --- a/yt/yt/core/ytree/ypath_service.cpp +++ b/yt/yt/core/ytree/ypath_service.cpp @@ -22,7 +22,7 @@ #include <yt/yt/core/concurrency/periodic_executor.h> #include <yt/yt/core/misc/checksum.h> -#include <yt/yt/core/misc/atomic_object.h> +#include <library/cpp/yt/threading/atomic_object.h> #include <library/cpp/yt/memory/atomic_intrusive_ptr.h> diff --git a/yt/yt/library/tracing/jaeger/tracer.h b/yt/yt/library/tracing/jaeger/tracer.h index ed4850b1e97..387b3a8360f 100644 --- a/yt/yt/library/tracing/jaeger/tracer.h +++ b/yt/yt/library/tracing/jaeger/tracer.h @@ -10,7 +10,7 @@ #include <yt/yt/library/tvm/service/public.h> #include <yt/yt/core/misc/mpsc_stack.h> -#include <yt/yt/core/misc/atomic_object.h> +#include <library/cpp/yt/threading/atomic_object.h> #include <yt/yt/core/rpc/grpc/config.h> |
