Skip to content

Commit 9faea68

Browse files
committed
load_acquire -> load_relaxed
1 parent 9533e27 commit 9faea68

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/ring_buffer/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ impl AtomicUsize {
2929
unsafe { &mut *self.v.get() }
3030
}
3131

32-
pub fn load_acquire(&self) -> usize {
33-
unsafe { intrinsics::atomic_load_acq(self.v.get()) }
34-
}
35-
3632
pub fn load_relaxed(&self) -> usize {
3733
unsafe { intrinsics::atomic_load_relaxed(self.v.get()) }
3834
}

src/ring_buffer/spsc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ where
4343
let buffer: &[T] = unsafe { rb.buffer.as_ref() };
4444

4545
let tail = rb.tail.load_relaxed();
46-
let head = rb.head.load_acquire();
46+
let head = rb.head.load_relaxed();
4747
if head != tail {
4848
let item = unsafe { ptr::read(buffer.get_unchecked(head)) };
4949
rb.head.store_release((head + 1) % n);
@@ -85,7 +85,7 @@ where
8585
let buffer: &mut [T] = unsafe { rb.buffer.as_mut() };
8686

8787
let head = rb.head.load_relaxed();
88-
let tail = rb.tail.load_acquire();
88+
let tail = rb.tail.load_relaxed();
8989
let next_tail = (tail + 1) % n;
9090
if next_tail != head {
9191
// NOTE(ptr::write) the memory slot that we are about to write to is uninitialized. We

0 commit comments

Comments
 (0)