Round stream_select fifth argument up.
- This argument must be an integer - An argument equal to 0 should be avoided as it consumes too much CPU time
This commit is contained in:
parent
3780fdb214
commit
bf4a9b083c
@ -290,7 +290,7 @@ class Process
|
|||||||
$w = $writePipes;
|
$w = $writePipes;
|
||||||
$e = null;
|
$e = null;
|
||||||
|
|
||||||
$n = @stream_select($r, $w, $e, 0, static::TIMEOUT_PRECISION * 1E6);
|
$n = @stream_select($r, $w, $e, 0, ceil(static::TIMEOUT_PRECISION * 1E6));
|
||||||
|
|
||||||
if (false === $n) {
|
if (false === $n) {
|
||||||
break;
|
break;
|
||||||
@ -360,7 +360,7 @@ class Process
|
|||||||
$e = null;
|
$e = null;
|
||||||
|
|
||||||
// let's have a look if something changed in streams
|
// let's have a look if something changed in streams
|
||||||
if (false === $n = @stream_select($r, $w, $e, 0, static::TIMEOUT_PRECISION * 1E6)) {
|
if (false === $n = @stream_select($r, $w, $e, 0, ceil(static::TIMEOUT_PRECISION * 1E6))) {
|
||||||
$lastError = error_get_last();
|
$lastError = error_get_last();
|
||||||
|
|
||||||
// stream_select returns false when the `select` system call is interrupted by an incoming signal
|
// stream_select returns false when the `select` system call is interrupted by an incoming signal
|
||||||
|
Reference in New Issue
Block a user