Use qload/qstore

This commit is contained in:
2022-06-02 08:25:47 +00:00
committed by GitHub
parent 36658a3753
commit 1f04bab3f4
4 changed files with 21 additions and 19 deletions

View File

@@ -17,9 +17,11 @@ pub trait AtomicQuick<T> {
macro_rules! impl_atomic_quick_with_atomic {
($type1:ty, $type2:ty) => {
impl AtomicQuick<$type2> for $type1 {
#[inline]
fn qload(&self) -> $type2 {
self.load(Ordering::Relaxed)
}
#[inline]
fn qstore(&self, value: $type2) {
self.store(value, Ordering::Relaxed)
}