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:
parent
3caca8743d
commit
2e3c8a351b
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue