From 345de4cd11427825ad4c246d82d97dd69a03d3c5 Mon Sep 17 00:00:00 2001 From: crs Date: Sun, 3 Aug 2003 21:24:45 +0000 Subject: [PATCH] Integrate fixes from 1.0 branch. --- lib/arch/CArchMultithreadWindows.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/arch/CArchMultithreadWindows.cpp b/lib/arch/CArchMultithreadWindows.cpp index e9101515..2a457a50 100644 --- a/lib/arch/CArchMultithreadWindows.cpp +++ b/lib/arch/CArchMultithreadWindows.cpp @@ -389,7 +389,7 @@ CArchMultithreadWindows::setPriorityOfThread(CArchThread thread, int n) assert(thread != NULL); size_t index; - if (s_pBase < n) { + if (n > 0 && s_pBase < n) { // lowest priority index = 0; } @@ -400,7 +400,7 @@ CArchMultithreadWindows::setPriorityOfThread(CArchThread thread, int n) index = s_pMax; } } - SetPriorityClass(thread->m_thread, s_pClass[index].m_class); + SetPriorityClass(GetCurrentProcess(), s_pClass[index].m_class); SetThreadPriority(thread->m_thread, s_pClass[index].m_level); } @@ -749,13 +749,13 @@ CArchMultithreadWindows::threadFunc(void* vrep) void CArchMultithreadWindows::doThreadFunc(CArchThread thread) { - // default priority is slightly below normal - setPriorityOfThread(thread, 1); - // wait for parent to initialize this object lockMutex(m_threadMutex); unlockMutex(m_threadMutex); + // default priority is slightly below normal + setPriorityOfThread(thread, 1); + void* result = NULL; try { // go