File tree 3 files changed +12
-6
lines changed
3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ use alloc::{
13
13
use crate :: buf:: IntoIter ;
14
14
#[ allow( unused) ]
15
15
use crate :: loom:: sync:: atomic:: AtomicMut ;
16
- use crate :: loom:: sync:: atomic:: { self , AtomicPtr , AtomicUsize , Ordering } ;
16
+ use crate :: loom:: sync:: atomic:: { AtomicPtr , AtomicUsize , Ordering } ;
17
17
use crate :: Buf ;
18
18
19
19
/// A cheaply cloneable and sliceable chunk of contiguous memory.
@@ -1095,7 +1095,10 @@ unsafe fn release_shared(ptr: *mut Shared) {
1095
1095
// > "acquire" operation before deleting the object.
1096
1096
//
1097
1097
// [1]: (www.boost.org/doc/libs/1_55_0/doc/html/atomic/usage_examples.html)
1098
- atomic:: fence ( Ordering :: Acquire ) ;
1098
+ //
1099
+ // Thread sanitizer does not support atomic fences. Use an atomic load
1100
+ // instead.
1101
+ ( * ptr) . ref_cnt . load ( Ordering :: Acquire ) ;
1099
1102
1100
1103
// Drop the data
1101
1104
Box :: from_raw ( ptr) ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ use crate::buf::{IntoIter, UninitSlice};
16
16
use crate :: bytes:: Vtable ;
17
17
#[ allow( unused) ]
18
18
use crate :: loom:: sync:: atomic:: AtomicMut ;
19
- use crate :: loom:: sync:: atomic:: { self , AtomicPtr , AtomicUsize , Ordering } ;
19
+ use crate :: loom:: sync:: atomic:: { AtomicPtr , AtomicUsize , Ordering } ;
20
20
use crate :: { Buf , BufMut , Bytes } ;
21
21
22
22
/// A unique reference to a contiguous slice of memory.
@@ -1288,7 +1288,10 @@ unsafe fn release_shared(ptr: *mut Shared) {
1288
1288
// > "acquire" operation before deleting the object.
1289
1289
//
1290
1290
// [1]: (www.boost.org/doc/libs/1_55_0/doc/html/atomic/usage_examples.html)
1291
- atomic:: fence ( Ordering :: Acquire ) ;
1291
+ //
1292
+ // Thread sanitizer does not support atomic fences. Use an atomic load
1293
+ // instead.
1294
+ ( * ptr) . ref_count . load ( Ordering :: Acquire ) ;
1292
1295
1293
1296
// Drop the data
1294
1297
Box :: from_raw ( ptr) ;
Original file line number Diff line number Diff line change 1
1
#[ cfg( not( all( test, loom) ) ) ]
2
2
pub ( crate ) mod sync {
3
3
pub ( crate ) mod atomic {
4
- pub ( crate ) use core:: sync:: atomic:: { fence , AtomicPtr , AtomicUsize , Ordering } ;
4
+ pub ( crate ) use core:: sync:: atomic:: { AtomicPtr , AtomicUsize , Ordering } ;
5
5
6
6
pub ( crate ) trait AtomicMut < T > {
7
7
fn with_mut < F , R > ( & mut self , f : F ) -> R
@@ -23,7 +23,7 @@ pub(crate) mod sync {
23
23
#[ cfg( all( test, loom) ) ]
24
24
pub ( crate ) mod sync {
25
25
pub ( crate ) mod atomic {
26
- pub ( crate ) use loom:: sync:: atomic:: { fence , AtomicPtr , AtomicUsize , Ordering } ;
26
+ pub ( crate ) use loom:: sync:: atomic:: { AtomicPtr , AtomicUsize , Ordering } ;
27
27
28
28
pub ( crate ) trait AtomicMut < T > { }
29
29
}
You can’t perform that action at this time.
0 commit comments