summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-12-16 16:23:00 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-09 21:00:06 (GMT)
commit0cc34cf0f4e9b64f3efa21ec57e7e27f4a6d879e (patch)
tree43dbbc49551adb9a56a6fda7cf2a8c7998315c5a /src/corelib/thread
parent85601df1af37ccc9d3b8d3942853ec2a82e15c2d (diff)
downloadQt-0cc34cf0f4e9b64f3efa21ec57e7e27f4a6d879e.zip
Qt-0cc34cf0f4e9b64f3efa21ec57e7e27f4a6d879e.tar.gz
Qt-0cc34cf0f4e9b64f3efa21ec57e7e27f4a6d879e.tar.bz2
qthread_win.cpp: Fix warnings when waiting for adopted threads.
Task-number: QTBUG-35591 Change-Id: I63169bd8a9758a7dad33d4231d3d6c9d71c7e252 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from qtbase/d1f8a5641615eb83bb36b4ada5913531d0da24f1) Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qthread_win.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index ad32d5b..5bee807 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -217,7 +217,11 @@ DWORD WINAPI qt_adopted_thread_watcher_function(LPVOID)
qt_adopted_thread_watcher_mutex.unlock();
DWORD ret = WAIT_TIMEOUT;
- int loops = (handlesCopy.count() / MAXIMUM_WAIT_OBJECTS) + 1, offset, count;
+ int count;
+ int offset;
+ int loops = handlesCopy.size() / MAXIMUM_WAIT_OBJECTS;
+ if (handlesCopy.size() % MAXIMUM_WAIT_OBJECTS)
+ ++loops;
if (loops == 1) {
// no need to loop, no timeout
offset = 0;