From d1fa89e1cce4dcc6bf15fc59196be6764fda51d1 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Thu, 6 Oct 2011 12:09:14 +0200 Subject: QHostInfo: fix a race condition under CE Merge-request: 1339 Reviewed-by: Joerg Bornemann --- src/network/kernel/qhostinfo_win.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp index 6fc5b7b..1052863 100644 --- a/src/network/kernel/qhostinfo_win.cpp +++ b/src/network/kernel/qhostinfo_win.cpp @@ -97,14 +97,15 @@ static void resolveLibrary() #if defined(Q_OS_WINCE) #include -QMutex qPrivCEMutex; +Q_GLOBAL_STATIC(QMutex, qPrivCEMutex) #endif QHostInfo QHostInfoAgent::fromName(const QString &hostName) { #if defined(Q_OS_WINCE) - QMutexLocker locker(&qPrivCEMutex); + QMutexLocker locker(qPrivCEMutex()); #endif + QWindowsSockInit winSock; // Load res_init on demand. -- cgit v0.12