From fb55e9a9b6002f11a8268fddf562f50b0e783789 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Thu, 23 Sep 2021 11:42:32 -0500 Subject: [PATCH] AcctIdx: when stop_flush is disabled, prepare to age (#20113) --- runtime/src/in_mem_accounts_index.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/src/in_mem_accounts_index.rs b/runtime/src/in_mem_accounts_index.rs index 925344452c..fd3ce951a2 100644 --- a/runtime/src/in_mem_accounts_index.rs +++ b/runtime/src/in_mem_accounts_index.rs @@ -502,9 +502,10 @@ impl InMemAccountsIndex { fn start_stop_flush(&self, stop: bool) { if stop { - self.stop_flush.fetch_add(1, Ordering::Acquire); - } else { - self.stop_flush.fetch_sub(1, Ordering::Release); + self.stop_flush.fetch_add(1, Ordering::Release); + } else if 1 == self.stop_flush.fetch_sub(1, Ordering::Release) { + // stop_flush went to 0, so this bucket could now be ready to be aged + self.storage.wait_dirty_or_aged.notify_one(); } }