From 4ae9126f2c7d34631ee7e77f64fa161dab76e8d2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 12 Oct 2018 19:02:41 +0200 Subject: logic/pipeline: attempt adjust thread priority Calling QThread::setPriority twice in a succession means: 1. if you can, set high priority a) if not allowed, highest won't work either b) if allowed, see below 2. if you can, set highest priority a) if highest is allowed, happy happy joy joy b) if not, at least high priority is successful Note that we don't have any return value from QThread::setPriority(). --- logic/pipeline.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'logic') diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp index e506b7cf..6a01b272 100644 --- a/logic/pipeline.cpp +++ b/logic/pipeline.cpp @@ -277,6 +277,7 @@ bool maybe_nan(const char* text, const char* fun, int line, const xs&... vals) # define nan_check(...) (void)(__VA_ARGS__) #endif + bool pipeline::maybe_enable_center_on_tracking_started() { if (!tracking_started) @@ -546,6 +547,9 @@ void pipeline::run() const MMRESULT mmres = timeBeginPeriod(1); #endif + setPriority(QThread::HighPriority); + setPriority(QThread::HighestPriority); + { static const char* const posechannels[6] = { "TX", "TY", "TZ", "Yaw", "Pitch", "Roll" }; static const char* const datachannels[5] = { "dt", "raw", "corrected", "filtered", "mapped" }; -- cgit v1.2.3