public void Tick() { int update_count = 0; MailboxCache mail_box = null; foreach (var obj in m_mailboxs) { mail_box = obj.Value; if (mail_box.NeedSave()) { mail_box.Save(); if (++update_count > 60) { break; //当次循环最大保存数量 } } } }