diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/threading/task_scheduler/task_scheduler_ut.cpp | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/threading/task_scheduler/task_scheduler_ut.cpp')
-rw-r--r-- | library/cpp/threading/task_scheduler/task_scheduler_ut.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/library/cpp/threading/task_scheduler/task_scheduler_ut.cpp b/library/cpp/threading/task_scheduler/task_scheduler_ut.cpp index 3b5203194a..2223dce650 100644 --- a/library/cpp/threading/task_scheduler/task_scheduler_ut.cpp +++ b/library/cpp/threading/task_scheduler/task_scheduler_ut.cpp @@ -14,9 +14,9 @@ class TTaskSchedulerTest: public TTestBase { class TCheckTask: public TTaskScheduler::IRepeatedTask { public: - TCheckTask(const TDuration& delay) - : Start_(Now()) - , Delay_(delay) + TCheckTask(const TDuration& delay) + : Start_(Now()) + , Delay_(delay) { AtomicIncrement(ScheduledTaskCounter_); } @@ -25,15 +25,15 @@ class TTaskSchedulerTest: public TTestBase { } bool Process() override { - const TDuration delay = Now() - Start_; + const TDuration delay = Now() - Start_; - if (delay < Delay_) { + if (delay < Delay_) { AtomicIncrement(BadTimeoutCounter_); } AtomicIncrement(ExecutedTaskCounter_); - - return false; + + return false; } static bool AllTaskExecuted() { @@ -45,8 +45,8 @@ class TTaskSchedulerTest: public TTestBase { } private: - TInstant Start_; - TDuration Delay_; + TInstant Start_; + TDuration Delay_; static TAtomic BadTimeoutCounter_; static TAtomic ScheduledTaskCounter_; static TAtomic ExecutedTaskCounter_; @@ -60,7 +60,7 @@ class TTaskSchedulerTest: public TTestBase { ScheduleCheckTask(10000); ScheduleCheckTask(5000); - Scheduler_.Start(); + Scheduler_.Start(); usleep(1000000); @@ -70,8 +70,8 @@ class TTaskSchedulerTest: public TTestBase { private: void ScheduleCheckTask(size_t delay) { - TDuration d = TDuration::MicroSeconds(delay); - + TDuration d = TDuration::MicroSeconds(delay); + Scheduler_.Add(new TCheckTask(d), d); } |