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>
bb10
Konstantin Ritt 2011-10-06 12:09:14 +02:00 committed by Qt by Nokia
parent cb2e618127
commit bb1f50b7b1
1 changed files with 3 additions and 2 deletions

View File

@ -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.