Added poll() implementation.