summaryrefslogtreecommitdiffstats
path: root/src/serialport/qserialport_win_p.h
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2014-08-14 21:50:05 +0400
committerDenis Shienkov <denis.shienkov@gmail.com>2014-08-28 21:17:50 +0200
commitb4d5bd813f591dc618e0fff2d55d93eeccb1a26e (patch)
tree1b08f7bea9b804501ce4b2181b1d66361a0059c8 /src/serialport/qserialport_win_p.h
parent286d64c202f461cb8ff5a4cc4c2320af8195b8f0 (diff)
Fix a race condition at writing on Windowsv5.3.2
1. The writeStarted flag shall be reset to false after bytesWritten() signal is emitted, but not before it. 2. In case of start of writing from the startAsyncWriteTimer it is necessary to call the startAsyncWrite() method but not the completeAsyncWrite() method. It give guarantees to exclude of race condition to multiple call of the WriteFile twice until the write operation is not completed. For example, a race condition is watched in case of writing data from the slots which are connected to the bytesWritten() signal from a device; or to the timeout() signal from a timer with zero interval. To checking of these scenarios are added additional autotests. Tested on Windows 8 with the on-board and USB serial ports, using Qt5. Task-number: QTBUG-40769 Change-Id: Iedabbf38847debeee795a10fd7a4c54c65d2a338 Reviewed-by: Patrick Noffke <patrick.noffke@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src/serialport/qserialport_win_p.h')
-rw-r--r--src/serialport/qserialport_win_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/serialport/qserialport_win_p.h b/src/serialport/qserialport_win_p.h
index f4297ef5..cf30c189 100644
--- a/src/serialport/qserialport_win_p.h
+++ b/src/serialport/qserialport_win_p.h
@@ -108,7 +108,7 @@ public:
bool startAsyncCommunication();
bool startAsyncRead();
- bool startAsyncWrite();
+ bool _q_startAsyncWrite();
bool emulateErrorPolicy();
void emitReadyRead();