From 9863a28fb7d6455633559c5cfaee752e1c9f7e93 Mon Sep 17 00:00:00 2001 From: Fan Xuan Zhe Date: Tue, 25 Nov 2025 11:40:37 +0800 Subject: [PATCH] machine_manager: Keep pause notifiers in order Make the pause notify messages execute in a controlled, sequential manner, rather than out of order. Signed-off-by: Fan Xuan Zhe --- machine_manager/src/notifier.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/machine_manager/src/notifier.rs b/machine_manager/src/notifier.rs index 36285f36..5b58fc4a 100644 --- a/machine_manager/src/notifier.rs +++ b/machine_manager/src/notifier.rs @@ -10,7 +10,7 @@ // NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. // See the Mulan PSL v2 for more details. -use std::collections::HashMap; +use std::collections::BTreeMap; use std::sync::{Arc, RwLock}; use log::error; @@ -22,14 +22,14 @@ static NOTIFIER_MANAGER: Lazy> = pub type PauseNOtifyCallback = dyn Fn(bool) + Send + Sync; struct NotifierManager { - pause_notifiers: HashMap>, + pause_notifiers: BTreeMap>, next_id: u64, } impl NotifierManager { fn new() -> Self { Self { - pause_notifiers: HashMap::new(), + pause_notifiers: BTreeMap::new(), next_id: 1, } } -- Gitee