QProcess/Win: do not use extended API for polling

We avoid entering an alertable wait state there, so calling
WaitForSingleObject() instead of the ...Ex() analog would be
appropriate.

Change-Id: I7cd23805519f18b3174f66537dcf4c0da5061ca0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This commit is contained in:
Alex Trotsenko 2021-03-27 15:45:45 +02:00
parent d8c6052815
commit db1c238a66

View File

@ -718,7 +718,8 @@ bool QProcessPrivate::waitForReadyRead(const QDeadlineTimer &deadline)
if (!pid)
return false;
if (WaitForSingleObjectEx(pid->hProcess, 0, false) == WAIT_OBJECT_0) {
if (WaitForSingleObject(pid->hProcess, 0) == WAIT_OBJECT_0) {
bool readyReadEmitted = drainOutputPipes();
if (pid)
processFinished();
@ -762,9 +763,8 @@ bool QProcessPrivate::waitForBytesWritten(const QDeadlineTimer &deadline)
if (!pid)
return false;
// Wait for the process to signal any change in its state,
// such as incoming data, or if the process died.
if (WaitForSingleObjectEx(pid->hProcess, 0, false) == WAIT_OBJECT_0) {
// Check if the process is signaling completion.
if (WaitForSingleObject(pid->hProcess, 0) == WAIT_OBJECT_0) {
drainOutputPipes();
if (pid)
processFinished();