make task poller loop exit condition more explicit.