summaryrefslogtreecommitdiff
path: root/src/plugins/bearer
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2011-10-07 14:45:47 +0200
committerJan-Arve Saether <jan-arve.saether@nokia.com>2011-10-07 14:45:47 +0200
commit1e8479b2aa781e6ce3fadf01294023fbc6ddbc22 (patch)
treef71430dfeddf810ab06ad496c3a31334537071ad /src/plugins/bearer
parenta0feeef52efde872c6d6e458c8e15616da0bf74f (diff)
downloadqt4-tools-1e8479b2aa781e6ce3fadf01294023fbc6ddbc22.tar.gz
don't lock the global mutex if there is nothing to protect
according to Thiago, setting the pointer with the same values *is* thread-safe Merge-request: 2655 Reviewed-by: Jan-Arve Saether <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/plugins/bearer')
-rw-r--r--src/plugins/bearer/nativewifi/main.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/plugins/bearer/nativewifi/main.cpp b/src/plugins/bearer/nativewifi/main.cpp
index cbdfd99316..d279631286 100644
--- a/src/plugins/bearer/nativewifi/main.cpp
+++ b/src/plugins/bearer/nativewifi/main.cpp
@@ -42,30 +42,18 @@
#include "qnativewifiengine.h"
#include "platformdefs.h"
-#include <QtCore/qmutex.h>
-#include <QtCore/private/qmutexpool_p.h>
#include <QtCore/private/qsystemlibrary_p.h>
#include <QtNetwork/private/qbearerplugin_p.h>
-#include <QtCore/qdebug.h>
-
#ifndef QT_NO_BEARERMANAGEMENT
QT_BEGIN_NAMESPACE
static void resolveLibrary()
{
- static volatile bool triedResolve = false;
-
+ static bool triedResolve = false;
if (!triedResolve) {
-#ifndef QT_NO_THREAD
- QMutexLocker locker(QMutexPool::globalInstanceGet(&local_WlanOpenHandle));
-#endif
-
- if (triedResolve)
- return;
-
QSystemLibrary wlanapi(QLatin1String("wlanapi"));
if (wlanapi.load()) {
local_WlanOpenHandle = (WlanOpenHandleProto)