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