diff options
author | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:17 +0300 |
commit | 4b11037e5a7d071c63e3c966199fe7102e6462e4 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/system | |
parent | 17e20fa084178ddcb16255f974dbde74fb93608b (diff) | |
download | ydb-4b11037e5a7d071c63e3c966199fe7102e6462e4.tar.gz |
Restoring authorship annotation for Daniil Cherednik <dcherednik@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system')
-rw-r--r-- | util/system/hp_timer.cpp | 2 | ||||
-rw-r--r-- | util/system/thread.cpp | 26 | ||||
-rw-r--r-- | util/system/thread.h | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/util/system/hp_timer.cpp b/util/system/hp_timer.cpp index 8121e8bce0..e4c3f21e6b 100644 --- a/util/system/hp_timer.cpp +++ b/util/system/hp_timer.cpp @@ -112,7 +112,7 @@ void NHPTimer::GetTime(STime* pTime) noexcept { double NHPTimer::GetTimePassed(STime* pTime) noexcept { STime old(*pTime); - *pTime = GetCycleCount(); + *pTime = GetCycleCount(); return GetSeconds(*pTime - old); } diff --git a/util/system/thread.cpp b/util/system/thread.cpp index 1733fb2942..6236746c2d 100644 --- a/util/system/thread.cpp +++ b/util/system/thread.cpp @@ -24,19 +24,19 @@ #include <util/generic/scope.h> #else #error "FIXME" -#endif - -bool SetHighestThreadPriority() { -#ifdef _win_ - return SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST); -#else - struct sched_param sch; - memset(&sch, 0, sizeof(sch)); - sch.sched_priority = 31; - return pthread_setschedparam(pthread_self(), SCHED_RR, &sch) == 0; -#endif -} - +#endif + +bool SetHighestThreadPriority() { +#ifdef _win_ + return SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST); +#else + struct sched_param sch; + memset(&sch, 0, sizeof(sch)); + sch.sched_priority = 31; + return pthread_setschedparam(pthread_self(), SCHED_RR, &sch) == 0; +#endif +} + namespace { using TParams = TThread::TParams; using TId = TThread::TId; diff --git a/util/system/thread.h b/util/system/thread.h index 8dfd202895..a6e8abdb5b 100644 --- a/util/system/thread.h +++ b/util/system/thread.h @@ -10,8 +10,8 @@ #include "defaults.h" #include "progname.h" -bool SetHighestThreadPriority(); - +bool SetHighestThreadPriority(); + class TThread { template <typename Callable> struct TCallableParams; |