WinCE: Remove QIncrementalSleepTimer from QProcess::waitForFinished

Remove a superfluous loop and thus the usage of QIncrementalSleepTimer
from QProcess::waitForFinished. We just wait for the process handle.
There's no need for a loop that checks multiple wait conditions.
This enables us to remove QWindowsPipeWriter from the Windows CE port in
a subsequent commit.

Change-Id: If6a82405227cf145263dba3726bae959e6871d0e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
bb10
Joerg Bornemann 2016-01-05 16:04:32 +01:00
parent 50ab7c16d4
commit 6e823d2832
1 changed files with 6 additions and 12 deletions

View File

@ -235,20 +235,14 @@ bool QProcessPrivate::waitForFinished(int msecs)
qDebug("QProcessPrivate::waitForFinished(%d)", msecs);
#endif
QIncrementalSleepTimer timer(msecs);
if (!pid)
return true;
forever {
if (!pid)
return true;
if (WaitForSingleObject(pid->hProcess, timer.nextSleepTime()) == WAIT_OBJECT_0) {
_q_processDied();
return true;
}
if (timer.hasTimedOut())
break;
if (WaitForSingleObject(pid->hProcess, msecs == -1 ? INFINITE : msecs) == WAIT_OBJECT_0) {
_q_processDied();
return true;
}
setError(QProcess::Timedout);
return false;
}