Just realize that `waitUntilEmpty` is not enough. In `waitUntilEmpty`, it only checks `eventQueue.isEmpty`. But when `eventQueue.isEmpty` is true, there is still a chance that listeners do not finish their jobs or the memory is not synchronized.