summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-07-09 03:04:20 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2019-07-11 14:29:08 +0200
commit335f1d02dc134bf11277c0573553c7c838cc6a9f (patch)
treed313e015e24aadef9ee147e27dd16094b770712a
parent0d3fb431458109918785b90e1c5bd2d42b586fa6 (diff)
parentb24e07cbcbf7d7846baaaab77d632a2422128ada (diff)
downloadqtserialport-335f1d02dc134bf11277c0573553c7c838cc6a9f.tar.gz
Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"
-rw-r--r--dist/changes-5.12.425
-rw-r--r--src/serialport/qwinoverlappedionotifier.cpp10
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()