Skip to content
Snippets Groups Projects
Commit 9faea687 authored by Jorge Aparicio's avatar Jorge Aparicio
Browse files

load_acquire -> load_relaxed

parent 9533e27f
No related branches found
No related tags found
No related merge requests found
......@@ -29,10 +29,6 @@ impl AtomicUsize {
unsafe { &mut *self.v.get() }
}
pub fn load_acquire(&self) -> usize {
unsafe { intrinsics::atomic_load_acq(self.v.get()) }
}
pub fn load_relaxed(&self) -> usize {
unsafe { intrinsics::atomic_load_relaxed(self.v.get()) }
}
......
......@@ -43,7 +43,7 @@ where
let buffer: &[T] = unsafe { rb.buffer.as_ref() };
let tail = rb.tail.load_relaxed();
let head = rb.head.load_acquire();
let head = rb.head.load_relaxed();
if head != tail {
let item = unsafe { ptr::read(buffer.get_unchecked(head)) };
rb.head.store_release((head + 1) % n);
......@@ -85,7 +85,7 @@ where
let buffer: &mut [T] = unsafe { rb.buffer.as_mut() };
let head = rb.head.load_relaxed();
let tail = rb.tail.load_acquire();
let tail = rb.tail.load_relaxed();
let next_tail = (tail + 1) % n;
if next_tail != head {
// NOTE(ptr::write) the memory slot that we are about to write to is uninitialized. We
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment