summaryrefslogtreecommitdiffstats
path: root/util/system
diff options
context:
space:
mode:
authorDaniil Cherednik <[email protected]>2022-02-10 16:50:16 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:50:16 +0300
commit17e20fa084178ddcb16255f974dbde74fb93608b (patch)
tree39605336c0b4d33928df69a256102c515fdf6ff5 /util/system
parent97df5ca7413550bf233fc6c7210e292fca0a51af (diff)
Restoring authorship annotation for Daniil Cherednik <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util/system')
-rw-r--r--util/system/hp_timer.cpp2
-rw-r--r--util/system/thread.cpp26
-rw-r--r--util/system/thread.h4
3 files changed, 16 insertions, 16 deletions
diff --git a/util/system/hp_timer.cpp b/util/system/hp_timer.cpp
index e4c3f21e6b4..8121e8bce0b 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 6236746c2d9..1733fb2942a 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 a6e8abdb5be..8dfd202895d 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;