summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-17 03:06:18 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-17 03:06:18 +0200
commit027c87e9b9cf1c13583ca6f4faf567f7a7167c60 (patch)
treee477592cbf7659583680b9c55a265ab21b41cb06 /src
parent78bfc0a93077dafb217f854782e14b65a5746949 (diff)
parentf6b43c36b3839dae54308a6437bbdd99ae9a44de (diff)
Merge remote-tracking branch 'origin/5.13' into 5.14
Diffstat (limited to 'src')
-rw-r--r--src/serialport/qwinoverlappedionotifier.cpp10
1 files changed, 3 insertions, 7 deletions
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()