private function waitForStreamsToChange($modified)
{
$write = array();
$except = array();
$result = stream_select($modified, $write, $except, 1);
if ($result === false) {
throw new \RuntimeException("stream_select() returned an error while waiting for all workers to finish.");
}
$this->modified = $modified;
return $result;
}