summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2011-10-06 12:09:14 +0200
committerJoerg Bornemann <joerg.bornemann@nokia.com>2011-10-06 12:09:14 +0200
commitd1fa89e1cce4dcc6bf15fc59196be6764fda51d1 (patch)
tree7e05a8eb3e96f131a750f9bf03ad7298906a5c7b
parentf2526089d4b84b0b2c8a511ff2c22a22a6f2ee73 (diff)
downloadqt4-tools-d1fa89e1cce4dcc6bf15fc59196be6764fda51d1.tar.gz
QHostInfo: fix a race condition under CE
Merge-request: 1339 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
-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.