1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-07 04:10:08 +00:00

Added a sleep to ChildProcess::waitForProcessToFinish() to avoid it wasting CPU

This commit is contained in:
jules 2018-01-15 12:02:20 +00:00
parent 3caca8743d
commit 2e3c8a351b

View file

@ -54,6 +54,8 @@ bool ChildProcess::waitForProcessToFinish (const int timeoutMs) const
{
if (! isRunning())
return true;
Thread::sleep (2);
}
while (timeoutMs < 0 || Time::getMillisecondCounter() < timeoutTime);
@ -66,8 +68,8 @@ String ChildProcess::readAllProcessOutput()
for (;;)
{
char buffer [512];
const int num = readProcessOutput (buffer, sizeof (buffer));
char buffer[512];
auto num = readProcessOutput (buffer, sizeof (buffer));
if (num <= 0)
break;