File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ use crate::{
1919use alloc:: fmt;
2020use core:: mem:: size_of;
2121use core:: ops:: ControlFlow ;
22- use core:: sync:: atomic:: { AtomicU64 , Ordering :: Relaxed } ;
22+ use core:: sync:: atomic:: {
23+ AtomicU64 ,
24+ Ordering :: { Acquire , Release } ,
25+ } ;
2326use num_traits:: ToPrimitive ;
2427
2528// HashIndex is intended to be same size with hash::PyHash
@@ -261,12 +264,12 @@ type PopInnerResult<T> = ControlFlow<Option<DictEntry<T>>>;
261264impl < T : Clone > Dict < T > {
262265 /// Monotonically increasing version counter for mutation tracking.
263266 pub fn version ( & self ) -> u64 {
264- self . version . load ( Relaxed )
267+ self . version . load ( Acquire )
265268 }
266269
267270 /// Bump the version counter after any mutation.
268271 fn bump_version ( & self ) {
269- self . version . fetch_add ( 1 , Relaxed ) ;
272+ self . version . fetch_add ( 1 , Release ) ;
270273 }
271274
272275 fn read ( & self ) -> PyRwLockReadGuard < ' _ , DictInner < T > > {
You can’t perform that action at this time.
0 commit comments