From 64a6892e8713c69e1f5ade929ec8035146de3f56 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 19 Jul 2015 00:53:39 +0200 Subject: don't set thread affinity for anything Fixes #174 --- opentrack/thread.hpp | 45 --------------------------------------------- opentrack/tracker.cpp | 3 --- 2 files changed, 48 deletions(-) delete mode 100644 opentrack/thread.hpp (limited to 'opentrack') 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 - - * 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 - -enum { - CORE_WORK = 1, - CORE_IPC = 0, -}; - -#ifdef _WIN32 -#include - -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 #include @@ -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 -- cgit v1.2.3