diff --git a/lib/arch/CArchMultithreadWindows.cpp b/lib/arch/CArchMultithreadWindows.cpp index ba2fef6d..e9101515 100644 --- a/lib/arch/CArchMultithreadWindows.cpp +++ b/lib/arch/CArchMultithreadWindows.cpp @@ -388,14 +388,17 @@ CArchMultithreadWindows::setPriorityOfThread(CArchThread thread, int n) assert(thread != NULL); - size_t index = s_pBase - n; - if (index < 0) { + size_t index; + if (s_pBase < n) { // lowest priority index = 0; } - else if (index > s_pMax) { - // highest priority - index = s_pMax; + else { + index = s_pBase - n; + if (index > s_pMax) { + // highest priority + index = s_pMax; + } } SetPriorityClass(thread->m_thread, s_pClass[index].m_class); SetThreadPriority(thread->m_thread, s_pClass[index].m_level); diff --git a/lib/synergy/CPrimaryScreen.cpp b/lib/synergy/CPrimaryScreen.cpp index 19bbc8b2..320733f0 100644 --- a/lib/synergy/CPrimaryScreen.cpp +++ b/lib/synergy/CPrimaryScreen.cpp @@ -40,7 +40,7 @@ void CPrimaryScreen::mainLoop() { // change our priority - CThread::getCurrentThread().setPriority(-13); + CThread::getCurrentThread().setPriority(-14); // run event loop try { diff --git a/lib/synergy/CSecondaryScreen.cpp b/lib/synergy/CSecondaryScreen.cpp index c3df69bb..e7e72e70 100644 --- a/lib/synergy/CSecondaryScreen.cpp +++ b/lib/synergy/CSecondaryScreen.cpp @@ -40,7 +40,7 @@ void CSecondaryScreen::mainLoop() { // change our priority - CThread::getCurrentThread().setPriority(-13); + CThread::getCurrentThread().setPriority(-14); // run event loop try {