[PATCH v10 08/15] event: Add an event for main_loop