summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qhostinfo_win.cpp
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2011-10-06 12:09:14 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-06 14:37:22 +0200
commitbb1f50b7b11fddec27efc4a436f64147f746f93e (patch)
treec9b75d817562acd39a5d360a2ff9eff79e6fc026 /src/network/kernel/qhostinfo_win.cpp
parentcb2e618127d881bec0dec57ae175a2a066a6d67a (diff)
QHostInfo: fix a race condition under CE
Merge-request: 1339 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Change-Id: Id1f977ad8f746ac848c355880cac688e256721d8 Reviewed-on: http://codereview.qt-project.org/6145 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'src/network/kernel/qhostinfo_win.cpp')
-rw-r--r--src/network/kernel/qhostinfo_win.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp
index 6fc5b7bd24..10528634db 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.h>
-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.