fix: more atomic orderings

This commit is contained in:
Saber Haj Rabiee
2025-03-29 01:49:22 -07:00
parent 40710adfd5
commit 02f4cfe437
3 changed files with 5 additions and 5 deletions

View File

@@ -49,8 +49,8 @@ fn can_create_custom_executor() {
let counter = Arc::new(AtomicUsize::new(0));
let counter_clone = Arc::clone(&counter);
Executor::spawn_local(async move {
counter_clone.store(1, Ordering::Release);
counter_clone.store(1, Ordering::SeqCst);
});
Executor::poll_local();
assert_eq!(counter.load(Ordering::Acquire), 1);
assert_eq!(counter.load(Ordering::SeqCst), 1);
}

View File

@@ -26,12 +26,12 @@ fn can_make_local_progress() {
Executor::spawn_local({
let counter = Arc::clone(&counter);
async move {
assert_eq!(counter.fetch_add(1, Ordering::AcqRel), 0);
assert_eq!(counter.fetch_add(1, Ordering::SeqCst), 0);
Executor::spawn_local(async {
// Should not crash
});
}
});
Executor::poll_local();
assert_eq!(counter.load(Ordering::Acquire), 1);
assert_eq!(counter.load(Ordering::SeqCst), 1);
}