diff options
author | eeight <eeight@yandex-team.ru> | 2022-02-10 16:46:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:19 +0300 |
commit | bd085aee9b4f7a0bee302ce687964ffb7098f986 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/threading/future/wait/wait.cpp | |
parent | 475c0a46f28166e83fd263badc7546377cddcabe (diff) | |
download | ydb-bd085aee9b4f7a0bee302ce687964ffb7098f986.tar.gz |
Restoring authorship annotation for <eeight@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/threading/future/wait/wait.cpp')
-rw-r--r-- | library/cpp/threading/future/wait/wait.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/library/cpp/threading/future/wait/wait.cpp b/library/cpp/threading/future/wait/wait.cpp index cc33f3189c..a173833a7f 100644 --- a/library/cpp/threading/future/wait/wait.cpp +++ b/library/cpp/threading/future/wait/wait.cpp @@ -1,17 +1,17 @@ -#include "wait.h" +#include "wait.h" #include "wait_group.h" #include "wait_policy.h" namespace NThreading { - namespace { + namespace { template <class WaitPolicy> - TFuture<void> WaitGeneric(const TFuture<void>& f1) { + TFuture<void> WaitGeneric(const TFuture<void>& f1) { return f1; } template <class WaitPolicy> - TFuture<void> WaitGeneric(const TFuture<void>& f1, const TFuture<void>& f2) { + TFuture<void> WaitGeneric(const TFuture<void>& f1, const TFuture<void>& f2) { TWaitGroup<WaitPolicy> wg; wg.Add(f1).Add(f2); @@ -19,13 +19,13 @@ namespace NThreading { return std::move(wg).Finish(); } - template <class WaitPolicy> - TFuture<void> WaitGeneric(TArrayRef<const TFuture<void>> futures) { + template <class WaitPolicy> + TFuture<void> WaitGeneric(TArrayRef<const TFuture<void>> futures) { if (futures.empty()) { return MakeFuture(); } if (futures.size() == 1) { - return futures.front(); + return futures.front(); } TWaitGroup<WaitPolicy> wg; @@ -39,44 +39,44 @@ namespace NThreading { //////////////////////////////////////////////////////////////////////////////// - TFuture<void> WaitAll(const TFuture<void>& f1) { - return WaitGeneric<TWaitPolicy::TAll>(f1); + TFuture<void> WaitAll(const TFuture<void>& f1) { + return WaitGeneric<TWaitPolicy::TAll>(f1); } - TFuture<void> WaitAll(const TFuture<void>& f1, const TFuture<void>& f2) { - return WaitGeneric<TWaitPolicy::TAll>(f1, f2); + TFuture<void> WaitAll(const TFuture<void>& f1, const TFuture<void>& f2) { + return WaitGeneric<TWaitPolicy::TAll>(f1, f2); } - TFuture<void> WaitAll(TArrayRef<const TFuture<void>> futures) { - return WaitGeneric<TWaitPolicy::TAll>(futures); + TFuture<void> WaitAll(TArrayRef<const TFuture<void>> futures) { + return WaitGeneric<TWaitPolicy::TAll>(futures); } //////////////////////////////////////////////////////////////////////////////// - TFuture<void> WaitExceptionOrAll(const TFuture<void>& f1) { - return WaitGeneric<TWaitPolicy::TExceptionOrAll>(f1); + TFuture<void> WaitExceptionOrAll(const TFuture<void>& f1) { + return WaitGeneric<TWaitPolicy::TExceptionOrAll>(f1); } - TFuture<void> WaitExceptionOrAll(const TFuture<void>& f1, const TFuture<void>& f2) { - return WaitGeneric<TWaitPolicy::TExceptionOrAll>(f1, f2); + TFuture<void> WaitExceptionOrAll(const TFuture<void>& f1, const TFuture<void>& f2) { + return WaitGeneric<TWaitPolicy::TExceptionOrAll>(f1, f2); } - TFuture<void> WaitExceptionOrAll(TArrayRef<const TFuture<void>> futures) { - return WaitGeneric<TWaitPolicy::TExceptionOrAll>(futures); + TFuture<void> WaitExceptionOrAll(TArrayRef<const TFuture<void>> futures) { + return WaitGeneric<TWaitPolicy::TExceptionOrAll>(futures); } //////////////////////////////////////////////////////////////////////////////// - TFuture<void> WaitAny(const TFuture<void>& f1) { - return WaitGeneric<TWaitPolicy::TAny>(f1); + TFuture<void> WaitAny(const TFuture<void>& f1) { + return WaitGeneric<TWaitPolicy::TAny>(f1); } - TFuture<void> WaitAny(const TFuture<void>& f1, const TFuture<void>& f2) { - return WaitGeneric<TWaitPolicy::TAny>(f1, f2); + TFuture<void> WaitAny(const TFuture<void>& f1, const TFuture<void>& f2) { + return WaitGeneric<TWaitPolicy::TAny>(f1, f2); } - TFuture<void> WaitAny(TArrayRef<const TFuture<void>> futures) { - return WaitGeneric<TWaitPolicy::TAny>(futures); + TFuture<void> WaitAny(TArrayRef<const TFuture<void>> futures) { + return WaitGeneric<TWaitPolicy::TAny>(futures); } } |