From b69bb01f11f5104d8e807c7a2bdc92d3ffa394b4 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sun, 29 Jan 2012 20:32:22 +0100 Subject: Use QBasicMutex instead of Q_GLOBAL_STATIC QMutex QBasicMutex is a POD and can be used as a static global object. in qpicture.cpp factoryLoader is used only once, and under the mutex, so there is no need for Q_GLOBAL_STATIC for it, it can be a function static in qhostinfo_unix.cpp the code seemed wrong while compiled with namespace and QT_NO_GETADDRINFO. I also could get rid of one include because it was included earlier. Change-Id: I3c700203c3e067266c20733f4bda8031446dbb86 Reviewed-by: Bradley T. Hughes --- src/network/kernel/qhostinfo_win.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/network/kernel/qhostinfo_win.cpp') diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp index be1d067cef..a00389e3ed 100644 --- a/src/network/kernel/qhostinfo_win.cpp +++ b/src/network/kernel/qhostinfo_win.cpp @@ -95,15 +95,11 @@ static void resolveLibrary() #endif } -#if defined(Q_OS_WINCE) -#include -Q_GLOBAL_STATIC(QMutex, qPrivCEMutex) -#endif - QHostInfo QHostInfoAgent::fromName(const QString &hostName) { #if defined(Q_OS_WINCE) - QMutexLocker locker(qPrivCEMutex()); + static QBasicMutex qPrivCEMutex; + QMutexLocker locker(&qPrivCEMutex); #endif QWindowsSockInit winSock; -- cgit v1.2.3