File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use std::{
3
3
ops:: { Deref , DerefMut } ,
4
4
sync:: atomic:: {
5
5
AtomicBool ,
6
- Ordering :: { Acquire , Release } ,
6
+ Ordering :: { AcqRel , Acquire , Release } ,
7
7
} ,
8
8
} ;
9
9
@@ -56,7 +56,7 @@ impl<T> FastLock<T> {
56
56
57
57
pub fn try_lock ( & self ) -> Option < FastLockGuard < ' _ , T > > {
58
58
let lock_result =
59
- self . lock . compare_exchange_weak ( false , true , Acquire , Acquire ) ;
59
+ self . lock . compare_exchange_weak ( false , true , AcqRel , Acquire ) ;
60
60
61
61
let success = lock_result. is_ok ( ) ;
62
62
Original file line number Diff line number Diff line change @@ -97,11 +97,11 @@ impl AccessQueue {
97
97
// install new writer
98
98
let new = Box :: into_raw ( Box :: new ( AccessBlock :: new ( item) ) ) ;
99
99
debug_delay ( ) ;
100
- let res = self . writing . compare_exchange_weak (
100
+ let res = self . writing . compare_exchange (
101
101
head,
102
102
new,
103
- Ordering :: Release ,
104
- Ordering :: Relaxed ,
103
+ Ordering :: AcqRel ,
104
+ Ordering :: Acquire ,
105
105
) ;
106
106
if res. is_err ( ) {
107
107
// we lost the CAS, free the new item that was
@@ -120,11 +120,11 @@ impl AccessQueue {
120
120
// we loop because maybe other threads are pushing stuff too
121
121
block. next . store ( full_list_ptr, Ordering :: Release ) ;
122
122
debug_delay ( ) ;
123
- ret = self . full_list . compare_exchange_weak (
123
+ ret = self . full_list . compare_exchange (
124
124
full_list_ptr,
125
125
head,
126
- Ordering :: Release ,
127
- Ordering :: Relaxed ,
126
+ Ordering :: AcqRel ,
127
+ Ordering :: Acquire ,
128
128
) ;
129
129
ret. is_err ( )
130
130
} {
You can’t perform that action at this time.
0 commit comments