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:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/threading/task_scheduler/task_scheduler_ut.cpp
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 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 2223dce650..3b5203194a 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);
}