equal
deleted
inserted
replaced
41 |
41 |
42 #include "qnativewifiengine_win_p.h" |
42 #include "qnativewifiengine_win_p.h" |
43 #include "qnetworkconfiguration_p.h" |
43 #include "qnetworkconfiguration_p.h" |
44 |
44 |
45 #include <QtCore/qmutex.h> |
45 #include <QtCore/qmutex.h> |
46 #include <QtCore/private/qmutexpool_p.h> |
|
47 #include <QtCore/qlibrary.h> |
46 #include <QtCore/qlibrary.h> |
48 #include <QtCore/qstringlist.h> |
47 #include <QtCore/qstringlist.h> |
49 |
48 |
50 #include <QtCore/qdebug.h> |
49 #include <QtCore/qdebug.h> |
51 |
50 |
328 static WlanDisconnectProto local_WlanDisconnect = 0; |
327 static WlanDisconnectProto local_WlanDisconnect = 0; |
329 static WlanScanProto local_WlanScan = 0; |
328 static WlanScanProto local_WlanScan = 0; |
330 static WlanFreeMemoryProto local_WlanFreeMemory = 0; |
329 static WlanFreeMemoryProto local_WlanFreeMemory = 0; |
331 static WlanCloseHandleProto local_WlanCloseHandle = 0; |
330 static WlanCloseHandleProto local_WlanCloseHandle = 0; |
332 |
331 |
|
332 Q_GLOBAL_STATIC_WITH_ARGS(QMutex, dynamicLoadMutex, (QMutex::Recursive)); |
|
333 |
333 static void resolveLibrary() |
334 static void resolveLibrary() |
334 { |
335 { |
335 static volatile bool triedResolve = false; |
336 static volatile bool triedResolve = false; |
336 |
337 |
337 if (!triedResolve) { |
338 if (!triedResolve) { |
338 #ifndef QT_NO_THREAD |
339 #ifndef QT_NO_THREAD |
339 QMutexLocker locker(QMutexPool::globalInstanceGet(&local_WlanOpenHandle)); |
340 QMutexLocker locker(dynamicLoadMutex()); |
340 #endif |
341 #endif |
341 |
342 |
342 if (!triedResolve) { |
343 if (!triedResolve) { |
343 local_WlanOpenHandle = (WlanOpenHandleProto) |
344 local_WlanOpenHandle = (WlanOpenHandleProto) |
344 QLibrary::resolve(QLatin1String("wlanapi.dll"), "WlanOpenHandle"); |
345 QLibrary::resolve(QLatin1String("wlanapi.dll"), "WlanOpenHandle"); |