diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 3a29216b4abb70..a2bd30d35d4bda 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -270,14 +270,14 @@ impl AccountMapEntryInner { } } pub fn ref_count(&self) -> RefCount { - self.ref_count.load(Ordering::Relaxed) + self.ref_count.load(Ordering::Acquire) } pub fn add_un_ref(&self, add: bool) { if add { - self.ref_count.fetch_add(1, Ordering::Relaxed); + self.ref_count.fetch_add(1, Ordering::Release); } else { - self.ref_count.fetch_sub(1, Ordering::Relaxed); + self.ref_count.fetch_sub(1, Ordering::Release); } self.set_dirty(true); }