Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfc7aeb9

Browse files
bug#28940 [Process] Adds usleep(1000) to ease CPU usage. (miniyarov)
This PR was squashed before being merged into the 4.2-dev branch (closes#28940).Discussion----------[Process] Adds usleep(1000) to ease CPU usage.| Q | A| ------------- | ---| Branch? | master| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR | symfony/symfony-docsCommits-------9d1416a [Process] Adds usleep(1000) to ease CPU usage.
2 parents717ff2d +9d1416a commitfc7aeb9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎src/Symfony/Component/Process/Process.php‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,10 @@ public function wait(callable $callback = null)
436436
* from the output in real-time while writing the standard input to the process.
437437
* It allows to have feedback from the independent process during execution.
438438
*
439-
* @param callable $callback
440-
*
441439
* @throws RuntimeException When process timed out
442440
* @throws LogicException When process is not yet started
443441
*/
444-
publicfunctionwaitUntil(callable$callback)
442+
publicfunctionwaitUntil(callable$callback):bool
445443
{
446444
$this->requireProcessIsStarted(__FUNCTION__);
447445
$this->updateStatus(false);
@@ -465,7 +463,14 @@ public function waitUntil(callable $callback)
465463
$this->fallbackStatus['exitcode'] = (int)$data;
466464
}
467465
}
466+
if ($wait && !$this->isRunning()) {
467+
returnfalse;
468+
}
469+
470+
usleep(1000);
468471
}while ($wait);
472+
473+
returntrue;
469474
}
470475

471476
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp