1
0
mirror of https://github.com/danog/amp.git synced 2024-11-27 04:24:42 +01:00

Fix endless native loop when no watchers remain

This commit is contained in:
Daniel Lowrey 2014-06-11 10:03:44 -04:00
parent 112eee97bf
commit b0a76277bb

View File

@ -72,6 +72,8 @@ class NativeReactor implements Reactor {
if ($this->readStreams || $this->writeStreams) { if ($this->readStreams || $this->writeStreams) {
$this->selectActionableStreams($timeToNextAlarm); $this->selectActionableStreams($timeToNextAlarm);
} elseif (!$this->alarmOrder) {
$this->stop();
} elseif ($timeToNextAlarm > 0) { } elseif ($timeToNextAlarm > 0) {
usleep($timeToNextAlarm * self::$MICROSECOND); usleep($timeToNextAlarm * self::$MICROSECOND);
} }