summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_win.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-12-24 00:56:59 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-12-24 00:56:59 +0100
commitf0fbff4c905fd3e21d7aefedd45d98cc9dd54018 (patch)
treec61f47f858a9ac6183676bd7aee378a6a2b84a19 /src/corelib/thread/qthread_win.cpp
parentd776937df91e46536f404c6868d64016b6038d7b (diff)
parent0e1ce36ae67de940b2d499ec7f23e520dce0f112 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'src/corelib/thread/qthread_win.cpp')
-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 903e72c151..28e13910d9 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -258,7 +258,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;