aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/task_scheduler/task_scheduler_ut.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/threading/task_scheduler/task_scheduler_ut.cpp
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-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.cpp24
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);
}