mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-14 00:00:13 +02:00
Add TSAN support (#541)
This commit is contained in:
+5
-2
@@ -13,7 +13,7 @@ use alloc::{
|
||||
use crate::buf::IntoIter;
|
||||
#[allow(unused)]
|
||||
use crate::loom::sync::atomic::AtomicMut;
|
||||
use crate::loom::sync::atomic::{self, AtomicPtr, AtomicUsize, Ordering};
|
||||
use crate::loom::sync::atomic::{AtomicPtr, AtomicUsize, Ordering};
|
||||
use crate::Buf;
|
||||
|
||||
/// A cheaply cloneable and sliceable chunk of contiguous memory.
|
||||
@@ -1095,7 +1095,10 @@ unsafe fn release_shared(ptr: *mut Shared) {
|
||||
// > "acquire" operation before deleting the object.
|
||||
//
|
||||
// [1]: (www.boost.org/doc/libs/1_55_0/doc/html/atomic/usage_examples.html)
|
||||
atomic::fence(Ordering::Acquire);
|
||||
//
|
||||
// Thread sanitizer does not support atomic fences. Use an atomic load
|
||||
// instead.
|
||||
(*ptr).ref_cnt.load(Ordering::Acquire);
|
||||
|
||||
// Drop the data
|
||||
Box::from_raw(ptr);
|
||||
|
||||
Reference in New Issue
Block a user