Switch event polling to wait for events.