diff options
author | somov <somov@yandex-team.ru> | 2022-02-10 16:45:47 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:47 +0300 |
commit | a5950576e397b1909261050b8c7da16db58f10b1 (patch) | |
tree | 7ba7677f6a4c3e19e2cefab34d16df2c8963b4d4 /contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal | |
parent | 81eddc8c0b55990194e112b02d127b87d54164a9 (diff) | |
download | ydb-a5950576e397b1909261050b8c7da16db58f10b1.tar.gz |
Restoring authorship annotation for <somov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal')
11 files changed, 90 insertions, 90 deletions
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/create_thread_identity.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/create_thread_identity.cc index 3c5764eeb9..b710b6e2a1 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/create_thread_identity.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/create_thread_identity.cc @@ -16,17 +16,17 @@ #include <new> // This file is a no-op if the required LowLevelAlloc support is missing. -#include "y_absl/base/internal/low_level_alloc.h" +#include "y_absl/base/internal/low_level_alloc.h" #ifndef ABSL_LOW_LEVEL_ALLOC_MISSING #include <string.h> -#include "y_absl/base/attributes.h" -#include "y_absl/base/internal/spinlock.h" -#include "y_absl/base/internal/thread_identity.h" -#include "y_absl/synchronization/internal/per_thread_sem.h" +#include "y_absl/base/attributes.h" +#include "y_absl/base/internal/spinlock.h" +#include "y_absl/base/internal/thread_identity.h" +#include "y_absl/synchronization/internal/per_thread_sem.h" -namespace y_absl { +namespace y_absl { ABSL_NAMESPACE_BEGIN namespace synchronization_internal { @@ -135,6 +135,6 @@ base_internal::ThreadIdentity* CreateThreadIdentity() { } // namespace synchronization_internal ABSL_NAMESPACE_END -} // namespace y_absl +} // namespace y_absl #endif // ABSL_LOW_LEVEL_ALLOC_MISSING diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/create_thread_identity.h b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/create_thread_identity.h index d93209f424..8264f55fb1 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/create_thread_identity.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/create_thread_identity.h @@ -20,15 +20,15 @@ // This file is separate from thread_identity.h because creating a new // ThreadIdentity requires slightly higher level libraries (per_thread_sem // and low_level_alloc) than accessing an existing one. This separation allows -// us to have a smaller //y_absl/base:base. +// us to have a smaller //y_absl/base:base. #ifndef ABSL_SYNCHRONIZATION_INTERNAL_CREATE_THREAD_IDENTITY_H_ #define ABSL_SYNCHRONIZATION_INTERNAL_CREATE_THREAD_IDENTITY_H_ -#include "y_absl/base/internal/thread_identity.h" -#include "y_absl/base/port.h" +#include "y_absl/base/internal/thread_identity.h" +#include "y_absl/base/port.h" -namespace y_absl { +namespace y_absl { ABSL_NAMESPACE_BEGIN namespace synchronization_internal { @@ -55,6 +55,6 @@ inline base_internal::ThreadIdentity* GetOrCreateCurrentThreadIdentity() { } // namespace synchronization_internal ABSL_NAMESPACE_END -} // namespace y_absl +} // namespace y_absl #endif // ABSL_SYNCHRONIZATION_INTERNAL_CREATE_THREAD_IDENTITY_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/graphcycles.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/graphcycles.cc index d8987c1a98..00fb2bd754 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/graphcycles.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/graphcycles.cc @@ -28,23 +28,23 @@ // (2) When a new edge (x->y) is inserted, do nothing if rank[x] < rank[y]. // (3) Otherwise: adjust ranks in the neighborhood of x and y. -#include "y_absl/base/attributes.h" +#include "y_absl/base/attributes.h" // This file is a no-op if the required LowLevelAlloc support is missing. -#include "y_absl/base/internal/low_level_alloc.h" +#include "y_absl/base/internal/low_level_alloc.h" #ifndef ABSL_LOW_LEVEL_ALLOC_MISSING -#include "y_absl/synchronization/internal/graphcycles.h" +#include "y_absl/synchronization/internal/graphcycles.h" #include <algorithm> #include <array> #include <limits> -#include "y_absl/base/internal/hide_ptr.h" -#include "y_absl/base/internal/raw_logging.h" -#include "y_absl/base/internal/spinlock.h" +#include "y_absl/base/internal/hide_ptr.h" +#include "y_absl/base/internal/raw_logging.h" +#include "y_absl/base/internal/spinlock.h" // Do not use STL. This module does not use standard memory allocation. -namespace y_absl { +namespace y_absl { ABSL_NAMESPACE_BEGIN namespace synchronization_internal { @@ -693,6 +693,6 @@ int GraphCycles::GetStackTrace(GraphId id, void*** ptr) { } // namespace synchronization_internal ABSL_NAMESPACE_END -} // namespace y_absl +} // namespace y_absl #endif // ABSL_LOW_LEVEL_ALLOC_MISSING diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/graphcycles.h b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/graphcycles.h index eaf130bc29..f7ca16bc61 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/graphcycles.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/graphcycles.h @@ -42,7 +42,7 @@ #include "y_absl/base/config.h" -namespace y_absl { +namespace y_absl { ABSL_NAMESPACE_BEGIN namespace synchronization_internal { @@ -136,6 +136,6 @@ class GraphCycles { } // namespace synchronization_internal ABSL_NAMESPACE_END -} // namespace y_absl +} // namespace y_absl #endif diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/kernel_timeout.h b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/kernel_timeout.h index ee4078702d..5640066a4e 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/kernel_timeout.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/kernel_timeout.h @@ -14,13 +14,13 @@ // // An optional absolute timeout, with nanosecond granularity, -// compatible with y_absl::Time. Suitable for in-register +// compatible with y_absl::Time. Suitable for in-register // parameter-passing (e.g. syscalls.) -// Constructible from a y_absl::Time (for a timeout to be respected) or {} +// Constructible from a y_absl::Time (for a timeout to be respected) or {} // (for "no timeout".) // This is a private low-level API for use by a handful of low-level // components that are friends of this class. Higher-level components -// should build APIs based on y_absl::Time and y_absl::Duration. +// should build APIs based on y_absl::Time and y_absl::Duration. #ifndef ABSL_SYNCHRONIZATION_INTERNAL_KERNEL_TIMEOUT_H_ #define ABSL_SYNCHRONIZATION_INTERNAL_KERNEL_TIMEOUT_H_ @@ -30,11 +30,11 @@ #include <algorithm> #include <limits> -#include "y_absl/base/internal/raw_logging.h" -#include "y_absl/time/clock.h" -#include "y_absl/time/time.h" +#include "y_absl/base/internal/raw_logging.h" +#include "y_absl/time/clock.h" +#include "y_absl/time/time.h" -namespace y_absl { +namespace y_absl { ABSL_NAMESPACE_BEGIN namespace synchronization_internal { @@ -46,7 +46,7 @@ class KernelTimeout { // A timeout that should expire at <t>. Any value, in the full // InfinitePast() to InfiniteFuture() range, is valid here and will be // respected. - explicit KernelTimeout(y_absl::Time t) : ns_(MakeNs(t)) {} + explicit KernelTimeout(y_absl::Time t) : ns_(MakeNs(t)) {} // No timeout. KernelTimeout() : ns_(0) {} @@ -54,7 +54,7 @@ class KernelTimeout { static KernelTimeout Never() { return {}; } // We explicitly do not support other custom formats: timespec, int64_t nanos. - // Unify on this and y_absl::Time, please. + // Unify on this and y_absl::Time, please. bool has_timeout() const { return ns_ != 0; } @@ -69,10 +69,10 @@ class KernelTimeout { // timeout. int64_t ns_; - static int64_t MakeNs(y_absl::Time t) { + static int64_t MakeNs(y_absl::Time t) { // optimization--InfiniteFuture is common "no timeout" value // and cheaper to compare than convert. - if (t == y_absl::InfiniteFuture()) return 0; + if (t == y_absl::InfiniteFuture()) return 0; int64_t x = ToUnixNanos(t); // A timeout that lands exactly on the epoch (x=0) needs to be respected, @@ -102,10 +102,10 @@ class KernelTimeout { if (!has_timeout()) { return kInfinite; } - // The use of y_absl::Now() to convert from absolute time to - // relative time means that y_absl::Now() cannot use anything that + // The use of y_absl::Now() to convert from absolute time to + // relative time means that y_absl::Now() cannot use anything that // depends on KernelTimeout (for example, Mutex) on Windows. - int64_t now = ToUnixNanos(y_absl::Now()); + int64_t now = ToUnixNanos(y_absl::Now()); if (ns_ >= now) { // Round up so that Now() + ms_from_now >= ns_. constexpr uint64_t max_nanos = @@ -151,6 +151,6 @@ inline struct timespec KernelTimeout::MakeAbsTimespec() { } // namespace synchronization_internal ABSL_NAMESPACE_END -} // namespace y_absl +} // namespace y_absl #endif // ABSL_SYNCHRONIZATION_INTERNAL_KERNEL_TIMEOUT_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/per_thread_sem.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/per_thread_sem.cc index 3e40e812a9..af152bf63a 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/per_thread_sem.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/per_thread_sem.cc @@ -13,18 +13,18 @@ // limitations under the License. // This file is a no-op if the required LowLevelAlloc support is missing. -#include "y_absl/base/internal/low_level_alloc.h" +#include "y_absl/base/internal/low_level_alloc.h" #ifndef ABSL_LOW_LEVEL_ALLOC_MISSING -#include "y_absl/synchronization/internal/per_thread_sem.h" +#include "y_absl/synchronization/internal/per_thread_sem.h" #include <atomic> -#include "y_absl/base/attributes.h" -#include "y_absl/base/internal/thread_identity.h" -#include "y_absl/synchronization/internal/waiter.h" +#include "y_absl/base/attributes.h" +#include "y_absl/base/internal/thread_identity.h" +#include "y_absl/synchronization/internal/waiter.h" -namespace y_absl { +namespace y_absl { ABSL_NAMESPACE_BEGIN namespace synchronization_internal { @@ -64,20 +64,20 @@ void PerThreadSem::Tick(base_internal::ThreadIdentity *identity) { } // namespace synchronization_internal ABSL_NAMESPACE_END -} // namespace y_absl +} // namespace y_absl extern "C" { ABSL_ATTRIBUTE_WEAK void ABSL_INTERNAL_C_SYMBOL(AbslInternalPerThreadSemPost)( - y_absl::base_internal::ThreadIdentity *identity) { - y_absl::synchronization_internal::Waiter::GetWaiter(identity)->Post(); + y_absl::base_internal::ThreadIdentity *identity) { + y_absl::synchronization_internal::Waiter::GetWaiter(identity)->Post(); } ABSL_ATTRIBUTE_WEAK bool ABSL_INTERNAL_C_SYMBOL(AbslInternalPerThreadSemWait)( - y_absl::synchronization_internal::KernelTimeout t) { + y_absl::synchronization_internal::KernelTimeout t) { bool timeout = false; - y_absl::base_internal::ThreadIdentity *identity; - identity = y_absl::synchronization_internal::GetOrCreateCurrentThreadIdentity(); + y_absl::base_internal::ThreadIdentity *identity; + identity = y_absl::synchronization_internal::GetOrCreateCurrentThreadIdentity(); // Ensure wait_start != 0. int ticker = identity->ticker.load(std::memory_order_relaxed); @@ -90,7 +90,7 @@ ABSL_ATTRIBUTE_WEAK bool ABSL_INTERNAL_C_SYMBOL(AbslInternalPerThreadSemWait)( } timeout = - !y_absl::synchronization_internal::Waiter::GetWaiter(identity)->Wait(t); + !y_absl::synchronization_internal::Waiter::GetWaiter(identity)->Wait(t); if (identity->blocked_count_ptr != nullptr) { identity->blocked_count_ptr->fetch_sub(1, std::memory_order_relaxed); diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/per_thread_sem.h b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/per_thread_sem.h index 2fc39ca130..1a747d4da9 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/per_thread_sem.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/per_thread_sem.h @@ -27,11 +27,11 @@ #include <atomic> -#include "y_absl/base/internal/thread_identity.h" -#include "y_absl/synchronization/internal/create_thread_identity.h" -#include "y_absl/synchronization/internal/kernel_timeout.h" +#include "y_absl/base/internal/thread_identity.h" +#include "y_absl/synchronization/internal/create_thread_identity.h" +#include "y_absl/synchronization/internal/kernel_timeout.h" -namespace y_absl { +namespace y_absl { ABSL_NAMESPACE_BEGIN class Mutex; @@ -80,14 +80,14 @@ class PerThreadSem { // Permitted callers. friend class PerThreadSemTest; - friend class y_absl::Mutex; - friend y_absl::base_internal::ThreadIdentity* CreateThreadIdentity(); + friend class y_absl::Mutex; + friend y_absl::base_internal::ThreadIdentity* CreateThreadIdentity(); friend void ReclaimThreadIdentity(void* v); }; } // namespace synchronization_internal ABSL_NAMESPACE_END -} // namespace y_absl +} // namespace y_absl // In some build configurations we pass --detect-odr-violations to the // gold linker. This causes it to flag weak symbol overrides as ODR @@ -97,18 +97,18 @@ ABSL_NAMESPACE_END // check. extern "C" { void ABSL_INTERNAL_C_SYMBOL(AbslInternalPerThreadSemPost)( - y_absl::base_internal::ThreadIdentity* identity); + y_absl::base_internal::ThreadIdentity* identity); bool ABSL_INTERNAL_C_SYMBOL(AbslInternalPerThreadSemWait)( - y_absl::synchronization_internal::KernelTimeout t); + y_absl::synchronization_internal::KernelTimeout t); } // extern "C" -void y_absl::synchronization_internal::PerThreadSem::Post( - y_absl::base_internal::ThreadIdentity* identity) { +void y_absl::synchronization_internal::PerThreadSem::Post( + y_absl::base_internal::ThreadIdentity* identity) { ABSL_INTERNAL_C_SYMBOL(AbslInternalPerThreadSemPost)(identity); } -bool y_absl::synchronization_internal::PerThreadSem::Wait( - y_absl::synchronization_internal::KernelTimeout t) { +bool y_absl::synchronization_internal::PerThreadSem::Wait( + y_absl::synchronization_internal::KernelTimeout t) { return ABSL_INTERNAL_C_SYMBOL(AbslInternalPerThreadSemWait)(t); } diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/thread_pool.h b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/thread_pool.h index 8b8912d494..3901ca7da3 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/thread_pool.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/thread_pool.h @@ -22,10 +22,10 @@ #include <thread> // NOLINT(build/c++11) #include <vector> -#include "y_absl/base/thread_annotations.h" -#include "y_absl/synchronization/mutex.h" +#include "y_absl/base/thread_annotations.h" +#include "y_absl/synchronization/mutex.h" -namespace y_absl { +namespace y_absl { ABSL_NAMESPACE_BEGIN namespace synchronization_internal { @@ -43,7 +43,7 @@ class ThreadPool { ~ThreadPool() { { - y_absl::MutexLock l(&mu_); + y_absl::MutexLock l(&mu_); for (size_t i = 0; i < threads_.size(); i++) { queue_.push(nullptr); // Shutdown signal. } @@ -56,7 +56,7 @@ class ThreadPool { // Schedule a function to be run on a ThreadPool thread immediately. void Schedule(std::function<void()> func) { assert(func != nullptr); - y_absl::MutexLock l(&mu_); + y_absl::MutexLock l(&mu_); queue_.push(std::move(func)); } @@ -69,8 +69,8 @@ class ThreadPool { while (true) { std::function<void()> func; { - y_absl::MutexLock l(&mu_); - mu_.Await(y_absl::Condition(this, &ThreadPool::WorkAvailable)); + y_absl::MutexLock l(&mu_); + mu_.Await(y_absl::Condition(this, &ThreadPool::WorkAvailable)); func = std::move(queue_.front()); queue_.pop(); } @@ -81,13 +81,13 @@ class ThreadPool { } } - y_absl::Mutex mu_; + y_absl::Mutex mu_; std::queue<std::function<void()>> queue_ ABSL_GUARDED_BY(mu_); std::vector<std::thread> threads_; }; } // namespace synchronization_internal ABSL_NAMESPACE_END -} // namespace y_absl +} // namespace y_absl #endif // ABSL_SYNCHRONIZATION_INTERNAL_THREAD_POOL_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/waiter.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/waiter.cc index 573ce9c6c5..da4629d20d 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/waiter.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/waiter.cc @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "y_absl/synchronization/internal/waiter.h" +#include "y_absl/synchronization/internal/waiter.h" -#include "y_absl/base/config.h" +#include "y_absl/base/config.h" #ifdef _WIN32 #include <windows.h> @@ -43,13 +43,13 @@ #include <new> #include <type_traits> -#include "y_absl/base/internal/raw_logging.h" -#include "y_absl/base/internal/thread_identity.h" -#include "y_absl/base/optimization.h" -#include "y_absl/synchronization/internal/kernel_timeout.h" +#include "y_absl/base/internal/raw_logging.h" +#include "y_absl/base/internal/thread_identity.h" +#include "y_absl/base/optimization.h" +#include "y_absl/synchronization/internal/kernel_timeout.h" -namespace y_absl { +namespace y_absl { ABSL_NAMESPACE_BEGIN namespace synchronization_internal { @@ -425,4 +425,4 @@ void Waiter::InternalCondVarPoke() { } // namespace synchronization_internal ABSL_NAMESPACE_END -} // namespace y_absl +} // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/waiter.h b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/waiter.h index e6fede411f..8065171c31 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/waiter.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/waiter.h @@ -16,7 +16,7 @@ #ifndef ABSL_SYNCHRONIZATION_INTERNAL_WAITER_H_ #define ABSL_SYNCHRONIZATION_INTERNAL_WAITER_H_ -#include "y_absl/base/config.h" +#include "y_absl/base/config.h" #ifdef _WIN32 #include <sdkddkver.h> @@ -35,9 +35,9 @@ #include <atomic> #include <cstdint> -#include "y_absl/base/internal/thread_identity.h" +#include "y_absl/base/internal/thread_identity.h" #include "y_absl/synchronization/internal/futex.h" -#include "y_absl/synchronization/internal/kernel_timeout.h" +#include "y_absl/synchronization/internal/kernel_timeout.h" // May be chosen at compile time via -DABSL_FORCE_WAITER_MODE=<index> #define ABSL_WAITER_MODE_FUTEX 0 @@ -57,7 +57,7 @@ #define ABSL_WAITER_MODE ABSL_WAITER_MODE_CONDVAR #endif -namespace y_absl { +namespace y_absl { ABSL_NAMESPACE_BEGIN namespace synchronization_internal { @@ -150,6 +150,6 @@ class Waiter { } // namespace synchronization_internal ABSL_NAMESPACE_END -} // namespace y_absl +} // namespace y_absl #endif // ABSL_SYNCHRONIZATION_INTERNAL_WAITER_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/ya.make b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/ya.make index 167e710a78..8d1461a559 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/ya.make +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/internal/ya.make @@ -12,11 +12,11 @@ LICENSE(Apache-2.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) PEERDIR( - contrib/restricted/abseil-cpp-tstring/y_absl/base - contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc - contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging - contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait - contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity + contrib/restricted/abseil-cpp-tstring/y_absl/base + contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc + contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging + contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait + contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity ) ADDINCL( |