| 396 | } |
| 397 | |
| 398 | bool EngineProcess::waitForFinished(int msecs) |
| 399 | { |
| 400 | if (!m_started) |
| 401 | return true; |
| 402 | |
| 403 | DWORD dwWait; |
| 404 | if (msecs == -1) |
| 405 | dwWait = INFINITE; |
| 406 | else |
| 407 | dwWait = msecs; |
| 408 | |
| 409 | DWORD ret = WaitForSingleObject(m_processInfo.hProcess, dwWait); |
| 410 | if (ret == WAIT_OBJECT_0) |
| 411 | { |
| 412 | // The blocking ReadFile call in the pipe reader should |
| 413 | // return now that the pipes are closed. But if it doesn't |
| 414 | // happen, the pipe reader will be terminated violently |
| 415 | // after the timeout. |
| 416 | m_reader->wait(10000); |
| 417 | onFinished(); |
| 418 | |
| 419 | return true; |
| 420 | } |
| 421 | return false; |
| 422 | } |
| 423 | |
| 424 | bool EngineProcess::waitForStarted(int msecs) |
| 425 | { |
no outgoing calls
no test coverage detected