diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2011-10-07 12:45:47 (GMT) |
---|---|---|
committer | Jan-Arve Saether <jan-arve.saether@nokia.com> | 2011-10-07 12:45:47 (GMT) |
commit | 1e8479b2aa781e6ce3fadf01294023fbc6ddbc22 (patch) | |
tree | f71430dfeddf810ab06ad496c3a31334537071ad /src/plugins/bearer/nativewifi/main.cpp | |
parent | a0feeef52efde872c6d6e458c8e15616da0bf74f (diff) | |
download | Qt-1e8479b2aa781e6ce3fadf01294023fbc6ddbc22.zip Qt-1e8479b2aa781e6ce3fadf01294023fbc6ddbc22.tar.gz Qt-1e8479b2aa781e6ce3fadf01294023fbc6ddbc22.tar.bz2 |
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/nativewifi/main.cpp')
-rw-r--r-- | src/plugins/bearer/nativewifi/main.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/plugins/bearer/nativewifi/main.cpp b/src/plugins/bearer/nativewifi/main.cpp index cbdfd99..d279631 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) |