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