소스 검색

arcswap: fix the wrong memory order

greatbridf 11 달 전
부모
커밋
d52fc5232b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/sync/arcswap.rs

+ 1 - 1
src/sync/arcswap.rs

@@ -36,7 +36,7 @@ impl<T> ArcSwap<T> {
     pub fn borrow(&self) -> BorrowedArc<T> {
         unsafe {
             BorrowedArc::from_raw(
-                NonNull::new(self.pointer.load(Ordering::Relaxed))
+                NonNull::new(self.pointer.load(Ordering::Acquire))
                     .expect("ArcSwap: pointer should not be null."),
             )
         }