From d1f8a5641615eb83bb36b4ada5913531d0da24f1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 16 Dec 2013 17:23:00 +0100 Subject: qthread_win.cpp: Fix warnings when waiting for adopted threads. Task-number: QTBUG-35591 Change-Id: I63169bd8a9758a7dad33d4231d3d6c9d71c7e252 Reviewed-by: Thiago Macieira --- src/corelib/thread/qthread_win.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/corelib/thread/qthread_win.cpp') diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp index 9d90583a28..037343c996 100644 --- a/src/corelib/thread/qthread_win.cpp +++ b/src/corelib/thread/qthread_win.cpp @@ -208,7 +208,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; -- cgit v1.2.3