[Process] Fix potential race condition leading to transient tests

This commit is contained in:
Nicolas Grekas 2015-12-30 09:46:06 +01:00
parent 06eec9d39f
commit 99fc428bdc

View File

@ -1072,13 +1072,10 @@ class Process
$callback = $this->callback;
foreach ($result as $type => $data) {
if (3 === $type) {
$this->fallbackStatus['running'] = false;
if (!isset($this->fallbackStatus['signaled'])) {
$this->fallbackStatus['exitcode'] = (int) $data;
}
} else {
if (3 !== $type) {
$callback($type === self::STDOUT ? self::OUT : self::ERR, $data);
} elseif (!isset($this->fallbackStatus['signaled'])) {
$this->fallbackStatus['exitcode'] = (int) $data;
}
}
}