diff options
author | lexeyo <lexeyo@yandex-team.ru> | 2022-02-10 16:50:52 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:52 +0300 |
commit | 7bd28c29ae2a1fba7a03bcf4c658af66fe1373bf (patch) | |
tree | 125a82183c08c617e85c03a2036a11878fe21fce /library/cpp/threading/future/subscription/wait_ut_common.cpp | |
parent | 00b32f5b0810b417c619169d137c29a64b54d464 (diff) | |
download | ydb-7bd28c29ae2a1fba7a03bcf4c658af66fe1373bf.tar.gz |
Restoring authorship annotation for <lexeyo@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/threading/future/subscription/wait_ut_common.cpp')
-rw-r--r-- | library/cpp/threading/future/subscription/wait_ut_common.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/library/cpp/threading/future/subscription/wait_ut_common.cpp b/library/cpp/threading/future/subscription/wait_ut_common.cpp index 9f961e7303..35a6121bb9 100644 --- a/library/cpp/threading/future/subscription/wait_ut_common.cpp +++ b/library/cpp/threading/future/subscription/wait_ut_common.cpp @@ -1,26 +1,26 @@ -#include "wait_ut_common.h" - -#include <util/random/shuffle.h> -#include <util/system/event.h> -#include <util/thread/pool.h> - -namespace NThreading::NTest::NPrivate { - -void ExecuteAndWait(TVector<std::function<void()>> jobs, TFuture<void> waiter, size_t threads) { - Y_ENSURE(threads > 0); - Shuffle(jobs.begin(), jobs.end()); - auto pool = CreateThreadPool(threads); - TManualEvent start; - for (auto& j : jobs) { - pool->SafeAddFunc( - [&start, job = std::move(j)]() { - start.WaitI(); - job(); - }); - } - start.Signal(); - waiter.Wait(); - pool->Stop(); -} - -} +#include "wait_ut_common.h" + +#include <util/random/shuffle.h> +#include <util/system/event.h> +#include <util/thread/pool.h> + +namespace NThreading::NTest::NPrivate { + +void ExecuteAndWait(TVector<std::function<void()>> jobs, TFuture<void> waiter, size_t threads) { + Y_ENSURE(threads > 0); + Shuffle(jobs.begin(), jobs.end()); + auto pool = CreateThreadPool(threads); + TManualEvent start; + for (auto& j : jobs) { + pool->SafeAddFunc( + [&start, job = std::move(j)]() { + start.WaitI(); + job(); + }); + } + start.Signal(); + waiter.Wait(); + pool->Stop(); +} + +} |