diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-19 00:53:39 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-19 00:53:39 +0200 |
commit | 64a6892e8713c69e1f5ade929ec8035146de3f56 (patch) | |
tree | fc66fb4d31a2590210274c90125f42d8d14e88e6 | |
parent | be325aa56c745720a6a5e8bbc966b0b79c591a9b (diff) |
don't set thread affinity for anything
Fixes #174
-rw-r--r-- | ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 3 | ||||
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | 3 | ||||
-rw-r--r-- | opentrack/thread.hpp | 45 | ||||
-rw-r--r-- | opentrack/tracker.cpp | 3 |
4 files changed, 0 insertions, 54 deletions
diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index f7e283f3..c0ce1f22 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -17,7 +17,6 @@ #include <opencv2/highgui/highgui.hpp> #include <opencv2/videoio.hpp> #include "opentrack/camera-names.hpp" -#include "opentrack/thread.hpp" #include "opentrack/opencv-calibration.hpp" typedef struct { @@ -76,8 +75,6 @@ void Tracker::getRT(cv::Matx33d& r_, cv::Vec3d& t_) void Tracker::run() { - Affinity thr; - int rint = s.resolution; if (rint < 0 || rint >= (int)(sizeof(resolution_choices) / sizeof(resolution_tuple))) rint = 0; diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp index 85ce0ad2..8ccfe2c4 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp @@ -11,7 +11,6 @@ #include <QDebug> #include <QFile> #include <QCoreApplication> -#include "opentrack/thread.hpp" #include "opentrack/camera-names.hpp" using namespace std; @@ -70,8 +69,6 @@ void Tracker_PT::run() QTextStream log_stream(&log_file); #endif - Affinity thr; - while((commands & ABORT) == 0) { const double dt = time.elapsed() * 1e-9; diff --git a/opentrack/thread.hpp b/opentrack/thread.hpp deleted file mode 100644 index 946f2972..00000000 --- a/opentrack/thread.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2014-2015, Stanislaw Halik <sthalik@misaki.pl> - - * Permission to use, copy, modify, and/or distribute this - * software for any purpose with or without fee is hereby granted, - * provided that the above copyright notice and this permission - * notice appear in all copies. - */ - -#pragma once - -#include <QDebug> - -enum { - CORE_WORK = 1, - CORE_IPC = 0, -}; - -#ifdef _WIN32 -#include <windows.h> - -class Affinity { -public: - Affinity(int core = CORE_WORK) - { - DWORD_PTR ret = SetThreadAffinityMask(GetCurrentThread(), 1 << core); - if (ret == 0) - qDebug() << "SetThreadAffinityMask" << GetLastError(); - last = ret; - } - ~Affinity() - { - if (last) - (void) SetThreadAffinityMask(GetCurrentThread(), last); - } -private: - DWORD_PTR last; -}; - -#else -class Affinity { -public: - Affinity(int core = CORE_WORK) {} - ~Affinity() {} -}; -#endif diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index fae0e8a2..1ab350d5 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -14,7 +14,6 @@ #include "tracker.h" -#include "opentrack/thread.hpp" #include <cmath> #include <algorithm> @@ -181,8 +180,6 @@ void Tracker::logic() void Tracker::run() { const int sleep_ms = 3; - Affinity thr(CORE_IPC); - #if defined(_WIN32) (void) timeBeginPeriod(1); #endif |