diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-21 03:00:56 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-21 03:00:56 +0200 |
commit | dd9e24251d505102fc026481599e74cb183dedb8 (patch) | |
tree | 19da1548e9da6dea45c966629e138265b3b8005e /src/serialport | |
parent | fa7860d29ce47f25c45edfa654866f8d39de0452 (diff) | |
parent | ba7eb7316d8586c6a30e759c26fed30c5b0ff5ae (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I5224b5071f216cfc8e7a92a5c47f0ddc0551071b
Diffstat (limited to 'src/serialport')
-rw-r--r-- | src/serialport/configure.json | 42 | ||||
-rw-r--r-- | src/serialport/qwinoverlappedionotifier.cpp | 10 |
2 files changed, 45 insertions, 7 deletions
diff --git a/src/serialport/configure.json b/src/serialport/configure.json new file mode 100644 index 00000000..f0e6c76e --- /dev/null +++ b/src/serialport/configure.json @@ -0,0 +1,42 @@ +{ + "module": "serialport", + "condition": "!config.integrity && !config.vxworks && !config.winrt && !config.uikit && !config.wasm", + "depends": [ + "core" + ], + "condition": "module.core", + + "tests": { + "ntddmodm": { + "label": "ntddmodm", + "type": "compile", + "test": { + "include": [ "windows.h", "ntddmodm.h"], + "main": [ + "GUID guid = GUID_DEVINTERFACE_MODEM;" + ] + } + } + }, + + "features": { + "ntddmodm": { + "label": "ntddmodm", + "disable": "input.ntddmodm == 'no'", + "condition": "tests.ntddmodm", + "output": [ + "privateFeature", + { "type": "define", "negative": true, "name": "QT_NO_REDEFINE_GUID_DEVINTERFACE_MODEM" } + ] + } + }, + + "summary": [ + { + "section": "Serial Port", + "entries": [ + "ntddmodm" + ] + } + ] +} diff --git a/src/serialport/qwinoverlappedionotifier.cpp b/src/serialport/qwinoverlappedionotifier.cpp index 233ee696..615dacc9 100644 --- a/src/serialport/qwinoverlappedionotifier.cpp +++ b/src/serialport/qwinoverlappedionotifier.cpp @@ -129,7 +129,6 @@ public: HANDLE hSemaphore = nullptr; HANDLE hResultsMutex = nullptr; QAtomicInt waiting; - QAtomicInt pendingNotifications; QQueue<IOResult> results; }; @@ -396,17 +395,14 @@ void QWinOverlappedIoNotifierPrivate::notify(DWORD numberOfBytes, DWORD errorCod results.enqueue(IOResult(numberOfBytes, errorCode, overlapped)); ReleaseMutex(hResultsMutex); ReleaseSemaphore(hSemaphore, 1, NULL); - if (!waiting && pendingNotifications-- == 0) + if (!waiting) emit q->_q_notify(); } void QWinOverlappedIoNotifierPrivate::_q_notified() { - int n = pendingNotifications.fetchAndStoreAcquire(0); - while (--n >= 0) { - if (WaitForSingleObject(hSemaphore, 0) == WAIT_OBJECT_0) - dispatchNextIoResult(); - } + if (WaitForSingleObject(hSemaphore, 0) == WAIT_OBJECT_0) + dispatchNextIoResult(); } OVERLAPPED *QWinOverlappedIoNotifierPrivate::dispatchNextIoResult() |