diff options
-rw-r--r-- | dist/changes-5.12.4 | 25 | ||||
-rw-r--r-- | src/serialport/qwinoverlappedionotifier.cpp | 10 |
2 files changed, 32 insertions, 3 deletions
diff --git a/dist/changes-5.12.4 b/dist/changes-5.12.4 new file mode 100644 index 0000000..5097cf7 --- /dev/null +++ b/dist/changes-5.12.4 @@ -0,0 +1,25 @@ +Qt 5.12.4 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.12.0 through 5.12.3. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Qt 5.12.4 Changes * +**************************************************************************** + + - Fixed enumeration of 'Gadget' (/dev/ttyGS*) serial devices + on Linux. diff --git a/src/serialport/qwinoverlappedionotifier.cpp b/src/serialport/qwinoverlappedionotifier.cpp index 615dacc..233ee69 100644 --- a/src/serialport/qwinoverlappedionotifier.cpp +++ b/src/serialport/qwinoverlappedionotifier.cpp @@ -129,6 +129,7 @@ public: HANDLE hSemaphore = nullptr; HANDLE hResultsMutex = nullptr; QAtomicInt waiting; + QAtomicInt pendingNotifications; QQueue<IOResult> results; }; @@ -395,14 +396,17 @@ void QWinOverlappedIoNotifierPrivate::notify(DWORD numberOfBytes, DWORD errorCod results.enqueue(IOResult(numberOfBytes, errorCode, overlapped)); ReleaseMutex(hResultsMutex); ReleaseSemaphore(hSemaphore, 1, NULL); - if (!waiting) + if (!waiting && pendingNotifications-- == 0) emit q->_q_notify(); } void QWinOverlappedIoNotifierPrivate::_q_notified() { - if (WaitForSingleObject(hSemaphore, 0) == WAIT_OBJECT_0) - dispatchNextIoResult(); + int n = pendingNotifications.fetchAndStoreAcquire(0); + while (--n >= 0) { + if (WaitForSingleObject(hSemaphore, 0) == WAIT_OBJECT_0) + dispatchNextIoResult(); + } } OVERLAPPED *QWinOverlappedIoNotifierPrivate::dispatchNextIoResult() |