From 45552d271ac70ab4aad07b1ca04eabe5da73a43b Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Thu, 20 May 2021 19:50:58 -0500 Subject: [PATCH] take mutex once in process_dead_slots (#17357) --- runtime/src/accounts_db.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 55084f347d..2aee0280db 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -1895,8 +1895,11 @@ impl AccountsDb { // If the slot is dead, remove the need to shrink the storages as // the storage entries will be purged. - for slot in dead_slots { - self.shrink_candidate_slots.lock().unwrap().remove(slot); + { + let mut list = self.shrink_candidate_slots.lock().unwrap(); + for slot in dead_slots { + list.remove(slot); + } } debug!(