From 1de6fd49d16d34d54d2813c30d2fef831b8d5c63 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 10 Jun 2015 12:44:43 +0200 Subject: Use "Ex"-versions of WaitForSingle/MultipleObject(s) where possible Not only should using the "Ex"-versions be the rule and not the exception on Windows, but it's only the only way to share as much code as possible between Desktop Windows and WinRT (which is pushed by Microsoft a lot). The current rule of Desktop and WinCE vs WinRT does not make a lot of sense any longer, as WinCE is getting less and less important. By moving these #ifdefs in favor of WinRT, WinCe code might be removed easier in the future. Change-Id: I0ef94fb14fbf8add9c2dfa2a3fb8036d25fb697d Reviewed-by: Friedemann Kleint Reviewed-by: Thiago Macieira --- src/corelib/thread/qmutex_win.cpp | 6 +++--- src/corelib/thread/qwaitcondition_win.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/corelib/thread') diff --git a/src/corelib/thread/qmutex_win.cpp b/src/corelib/thread/qmutex_win.cpp index c4130fdba5..c24ea58868 100644 --- a/src/corelib/thread/qmutex_win.cpp +++ b/src/corelib/thread/qmutex_win.cpp @@ -55,10 +55,10 @@ QMutexPrivate::~QMutexPrivate() bool QMutexPrivate::wait(int timeout) { -#ifndef Q_OS_WINRT - return (WaitForSingleObject(event, timeout < 0 ? INFINITE : timeout) == WAIT_OBJECT_0); -#else +#ifndef Q_OS_WINCE return (WaitForSingleObjectEx(event, timeout < 0 ? INFINITE : timeout, FALSE) == WAIT_OBJECT_0); +#else + return (WaitForSingleObject(event, timeout < 0 ? INFINITE : timeout) == WAIT_OBJECT_0); #endif } diff --git a/src/corelib/thread/qwaitcondition_win.cpp b/src/corelib/thread/qwaitcondition_win.cpp index ef8330570e..3ea34461d3 100644 --- a/src/corelib/thread/qwaitcondition_win.cpp +++ b/src/corelib/thread/qwaitcondition_win.cpp @@ -109,10 +109,10 @@ bool QWaitConditionPrivate::wait(QWaitConditionEvent *wce, unsigned long time) { // wait for the event bool ret = false; -#ifndef Q_OS_WINRT - switch (WaitForSingleObject(wce->event, time)) { -#else +#ifndef Q_OS_WINCE switch (WaitForSingleObjectEx(wce->event, time, FALSE)) { +#else + switch (WaitForSingleObject(wce->event, time)) { #endif default: break; -- cgit v1.2.3